Tidy the standby code around Wake and Sleep (0.2.54)
One rule ends a Sleep: a tap, Wake or an alert. The Auto standby switch cleared sleep_requested when Home Assistant turned standby off, while ESP Screens and the settings page on the screen did not; now only wake_display clears the flag, and apply_screen_settings still wakes a screen the standby time dimmed. dim_display no longer checks anything itself (the interval checks Auto standby, the Sleep button sets the flag). It dims, then runs go_home with "also on standby" on, otherwise closes the settings page and every card through close_cards. Before, it copied half of go_home and hid the four YAML overlays itself, so a runtime detail card stayed open under a dimmed screen. close_cards is now the one runtime_tiles::dismiss() call: the fallback and the widget.hide actions after its return ran for nothing. The backlight light becomes internal. Home Assistant could change it, but the minute tick put the level back, and switching it off darkened the screen without standby. The brightness numbers and Wake/Sleep replace it. A dead clock-label branch from the manual profile leaves apply_screen_settings. Checked with 209 Python and 14 C++ tests, host builds of both boards over the native API, and ESP32 builds of both Easy profiles. Firmware 0.2.46. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -220,7 +220,8 @@ with the `button.press` action:
|
||||
time starts counting again. On a screen that is already on, only the count starts again.
|
||||
- **`button.<screen>_sleep`** puts the screen in standby right away, the same as when the standby
|
||||
time runs out, and also works with **Auto standby** off. The screen stays in standby until someone
|
||||
taps it, **Wake** is pressed or an alert comes in. An alert that is showing closes (reported as `remote`).
|
||||
taps it, **Wake** is pressed or an alert comes in; switching Auto standby off doesn't end it. An alert
|
||||
that is showing closes (reported as `remote`).
|
||||
|
||||
Neither button saves anything on the screen, so an automation may press them as often as it likes,
|
||||
on every motion too. That is the difference with the **Auto standby** switch, which is a setting.
|
||||
|
||||
Reference in New Issue
Block a user