diff --git a/esphome/epaperframe.yaml b/esphome/epaperframe.yaml index 8134bd0..55c58f0 100644 --- a/esphome/epaperframe.yaml +++ b/esphome/epaperframe.yaml @@ -1223,7 +1223,8 @@ display: const int first_weekday = weekday_monday(year, month, 1); const int month_days = days_in_month(year, month); - for (int row = 0; row < 6; row++) { + const int calendar_rows = (first_weekday + month_days + 6) / 7; + for (int row = 0; row < calendar_rows; row++) { const int monday_day = 1 - first_weekday + row * 7; int week_year = year; int week_month = month; diff --git a/python_scripts/epaper_calendar_data.py b/python_scripts/epaper_calendar_data.py index b5e38f5..47f73de 100644 --- a/python_scripts/epaper_calendar_data.py +++ b/python_scripts/epaper_calendar_data.py @@ -6,8 +6,8 @@ CALENDAR_NAMES = { DAY_NAMES = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"] MAX_ENTRIES = 8 # Reserve the right side of each row for start and end times. -MAX_TITLE_LENGTH = 19 -MAX_META_LENGTH = 28 +MAX_TITLE_LENGTH = 25 +MAX_META_LENGTH = 35 def shorten(value, maximum):