[presto] update clock on wake up
This commit is contained in:
+1
-1
@@ -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.
|
||||
- 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
|
||||
|
||||
|
||||
@@ -469,7 +469,8 @@ def sleep_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
|
||||
|
||||
try:
|
||||
@@ -478,8 +479,13 @@ def wake_display():
|
||||
pass
|
||||
|
||||
_display_awake = True
|
||||
|
||||
# Refresh today's date from the system clock (may have crossed midnight).
|
||||
set_today()
|
||||
|
||||
if not wifi_connected():
|
||||
if ensure_wifi_connected():
|
||||
ensure_wifi_connected()
|
||||
|
||||
redraw_current_view()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user