[presto] update clock on wake up

This commit is contained in:
Claudio Ortolina
2026-05-07 08:24:58 +01:00
parent 32a47bda47
commit ed9556a479
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ _These rules apply to any scrollable view (day list, detail page, or future addi
- Sleep by setting backlight to `0.0`. WiFi stays enabled. - Sleep by setting backlight to `0.0`. WiFi stays enabled.
- The first touch after sleep must wake the backlight and be consumed — it must not also activate a button or trigger a scroll. - The first touch after sleep must wake the backlight and be consumed — it must not also activate a button or trigger a scroll.
- On wake, only reconnect WiFi if the connection dropped. - On wake, `set_today()` refreshes the global date from the system clock, WiFi is reconnected if it dropped, and the current view is always redrawn so the today-highlight stays current across midnight.
## API Contract ## API Contract
+8 -2
View File
@@ -469,7 +469,8 @@ def sleep_display():
def wake_display(): def wake_display():
"""Restore the display backlight and reconnect WiFi if needed.""" """Restore the display backlight, refresh the clock, reconnect WiFi if
needed, and redraw so the today-highlight stays current."""
global _display_awake global _display_awake
try: try:
@@ -478,8 +479,13 @@ def wake_display():
pass pass
_display_awake = True _display_awake = True
# Refresh today's date from the system clock (may have crossed midnight).
set_today()
if not wifi_connected(): if not wifi_connected():
if ensure_wifi_connected(): ensure_wifi_connected()
redraw_current_view() redraw_current_view()