Let Home Assistant automations switch Auto standby per screen, and teach the skill (0.2.48)
App 0.2.48 / firmware 0.2.41: - Both boards expose the switch "Auto standby", the same standby_enabled setting as the checkbox in ESP Screens. Off wakes a dimmed screen and keeps it on; on counts the standby time from that moment. The change is saved on the screen and reported through esphome.screen_setting, so ESP Screens stores it too. No action runs at boot (restore_mode DISABLED). - The Claude skill gains "Standby and brightness": the switch, Standby after and the three brightness numbers, with an example automation that keeps screens awake while someone is home and a light is on or a window is open. - EASY_SETUP and the README describe the entities and the automation. Tested through Home Assistant's API on both bench boards (CYD: dimmed -> off wakes in 1.1 s, stays bright past the standby time, on dims again after 61 s); see docs/TEST_RESULTS_0248.md, which also records a CYD rollback after the first OTA that points to memory headroom, not to this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+28
-1
@@ -57,7 +57,7 @@
|
||||
############################################################
|
||||
|
||||
substitutions:
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.40"
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.41"
|
||||
# A tap survives a finger that drifts up to this far (320 px over 58 mm: 1 cm); further is a swipe.
|
||||
TOUCH_MOVE_LIMIT_PX: "56"
|
||||
# Shortest contact that counts as a tap; a resistive panel bounces, a capacitive one does not.
|
||||
@@ -2116,6 +2116,33 @@ text_sensor:
|
||||
switch:
|
||||
- platform: restart
|
||||
name: "Restart"
|
||||
# Auto standby, the same setting as the checkbox in ESP Screens (firmware 0.2.41+), so Home Assistant
|
||||
# automations can keep a screen on. Off wakes the screen and keeps it on; on counts the standby time
|
||||
# from that moment. Nothing runs at boot: the switch follows the saved setting.
|
||||
- platform: template
|
||||
id: setting_auto_standby
|
||||
name: "Auto standby"
|
||||
icon: "mdi:sleep"
|
||||
entity_category: config
|
||||
restore_mode: DISABLED
|
||||
lambda: return screen_settings::current.standby_enabled;
|
||||
turn_on_action:
|
||||
- lambda: |-
|
||||
auto &s = screen_settings::current;
|
||||
id(last_touch_ms) = millis();
|
||||
if (s.standby_enabled) return;
|
||||
s.standby_enabled = true;
|
||||
if (runtime_tiles::enabled) runtime_tiles::settings_preference.save(&s);
|
||||
runtime_tiles::setting_event("standby_enabled", 1);
|
||||
id(apply_screen_settings).execute();
|
||||
turn_off_action:
|
||||
- lambda: |-
|
||||
auto &s = screen_settings::current;
|
||||
if (!s.standby_enabled) return;
|
||||
s.standby_enabled = false;
|
||||
if (runtime_tiles::enabled) runtime_tiles::settings_preference.save(&s);
|
||||
runtime_tiles::setting_event("standby_enabled", 0);
|
||||
id(apply_screen_settings).execute();
|
||||
|
||||
# Two SPI buses used by the CYD:
|
||||
# - lcd: built-in display
|
||||
|
||||
Reference in New Issue
Block a user