Add scrolling, countdown, stopwatch, images, seconds, multiplier and degree sign

- Text elements can scroll in a window at a set speed; clock, countdown and
  stopwatch can show seconds. Moving pages are sent as instant frames (new
  Nano command D1) and paced by the estimated flip time.
- Countdown to a date and time (smart, days, days + time, with seconds),
  stopwatch (web UI, HA switch and reset button), image element (fixed or
  by Home Assistant state), multiplier for HA values, degree sign (char 127)
  in all fonts and the font converter.
- Page format version 2; version 1 pages are converted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-15 21:01:14 +02:00
1 parent ca8d78ea8a
commit fc6fa1a180
38 files changed
+1370 -277

No files matched your search

+15 -6
View File
@@ -119,7 +119,7 @@ void DisplayController::update(uint32_t now, bool time_valid, const LocalTime &t
_off_timer.cancel();
_ensureOn();
if (_page == Page::Dynamic)
_showDynamic(time, show_no_wifi);
_showDynamic(now, time, show_no_wifi);
else
_showOnce(Screen::Page);
break;
@@ -139,17 +139,26 @@ void DisplayController::_ensureOn()
_screen = Screen::Unknown;
}
// Drawn again each minute (time, date and background can change) and when the content changed
void DisplayController::_showDynamic(const LocalTime &time, bool no_wifi)
// Drawn again each minute (time, date and background can change), when the content changed,
// and as often as a moving page asks for (scrolling, seconds)
void DisplayController::_showDynamic(uint32_t now, const LocalTime &time, bool no_wifi)
{
Screen screen = no_wifi ? Screen::NoWifi : Screen::Dynamic;
if (_screen == screen && _shown_hour == time.hour && _shown_minute == time.minute &&
_shown_revision == _content_revision)
bool redraw = _screen != screen || _shown_revision != _content_revision;
bool due = screen == Screen::Dynamic && _dynamic_moving && (int32_t)(now - _dynamic_due) >= 0;
if (!redraw && !due && _shown_hour == time.hour && _shown_minute == time.minute)
return;
if (no_wifi)
{
_frames.noWifi(time.hour, time.minute);
_dynamic_moving = false;
}
else
_frames.dynamicPage(time);
{
uint32_t wait = _frames.dynamicPage(time, now, redraw);
_dynamic_moving = wait != 0;
_dynamic_due = now + wait;
}
_screen = screen;
_shown_hour = time.hour;
_shown_minute = time.minute;