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:
Max Gramser
2026-09-16 10:50:43 +02:00
parent da20782d3d
commit f3af5c2125
12 changed files with 207 additions and 182 deletions
+10
View File
@@ -1,3 +1,13 @@
## 0.2.54 (firmware 0.2.46)
The standby code, tidied after a review of Wake and Sleep.
- **One rule for Sleep.** A screen put to sleep with Sleep stays asleep until someone taps it, Wake is pressed or an alert comes in. Switching Auto standby off from Home Assistant used to end it, while the same switch in ESP Screens or on the screen did not; now none of them do. Switching Auto standby off still wakes a screen that its standby time dimmed.
- **Standby closes every card.** The settings page and any open card close when the screen goes into standby, and with "also on standby" on it goes back to page 1 as well. Until now a weather or media card stayed open under a dimmed screen while a light or climate card closed.
- **The backlight light is gone from Home Assistant.** `Display Backlight` (on the CYD `Power Display Backlight`) fought the screen's own brightness: the screen put its level back within a minute, and switching the light off made the screen dark without standby, so taps landed on tiles you couldn't see. Use the brightness numbers and the Wake and Sleep buttons. If Home Assistant still lists the old light as unavailable after the update, you can delete it there.
- Under the hood: standby goes through the same scripts as "back to page 1", every card closes through one call, and a leftover of the old manual profile is gone.
- Needs firmware 0.2.46: press **Update** on the screen.
## 0.2.53 (firmware 0.2.45)
Wake a screen or put it to sleep from Home Assistant.
+1 -1
View File
@@ -258,7 +258,7 @@ Every screen has these entities in Home Assistant, on its ESPHome device. `<scre
|---|---|
| `button.<screen>_wake` | Wakes the screen the way a tap does and counts the standby time from that moment; a screen that is already on only restarts that count. Firmware {WAKE_SLEEP_MIN_FIRMWARE} or newer. |
| `button.<screen>_sleep` | Puts the screen in standby right away, also with Auto standby off, and closes an alert that is showing. It stays in standby until someone taps it, Wake is pressed or an alert arrives. Firmware {WAKE_SLEEP_MIN_FIRMWARE} or newer. |
| `switch.<screen>_auto_standby` | On: the screen dims after the standby time without a touch. Off: the screen wakes up and stays on. Firmware {AUTO_STANDBY_MIN_FIRMWARE} or newer. |
| `switch.<screen>_auto_standby` | On: the screen dims after the standby time without a touch. Off: the screen wakes up and stays on, except after Sleep, which holds until Wake, a tap or an alert. Firmware {AUTO_STANDBY_MIN_FIRMWARE} or newer. |
| `number.<screen>_standby_after` | Seconds without a touch before standby, 60 to 86400. |
| `number.<screen>_normal_brightness` | Brightness while in use, 5 to 100 %. |
| `number.<screen>_standby_brightness` | Brightness in standby, 0 to 100 %, at most the normal brightness. |
+1 -1
View File
@@ -17,7 +17,7 @@ WEEKDAYS = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']
REPO = 'https://github.com/MaxGramser/homeassistant_espscreen'
REFS = {'cyd': 'main', 'guition': 'main'}
# Firmware shipped with this app release; screens below it get an update offer.
FIRMWARE_VERSION = '0.2.45'
FIRMWARE_VERSION = '0.2.46'
# The Auto standby switch a screen offers Home Assistant automations.
AUTO_STANDBY_MIN_FIRMWARE = '0.2.41'
# The settings page the screen opens itself, and the screen.settings tile that opens it.
+1 -1
View File
@@ -1,5 +1,5 @@
name: ESP Screen Manager
version: "0.2.53"
version: "0.2.54"
slug: esp_screen_manager
description: Choose tiles for your CYD and Guition touchscreen, without reflashing.
url: https://github.com/MaxGramser/homeassistant_espscreen