Keep a slider's value when you let go, and stop needless full resends (0.2.55)
A light's colour slider on Studio 1 sometimes sent red on release. Measured live: an automation with a state trigger on a six-lamp group (no `to:`) set "Standby after" to its current value after every colour change. The screen reported the setting, ESP Screen Manager saved the layout and resent layout, header and every tile state, and the screen drew its whole page again, reading no touch input meanwhile. The GT911's stray (0, 0) contact then became the finger's last position, and LVGL 9.5 set the slider from it on release. Both red commits left 75-85 ms after such a resync. The app no longer saves or resends a setting event whose value the layout already has. The four setting numbers return before the preference write and the event when nothing changed. A layout message that changes nothing on the screen no longer runs layout_changed() and refresh_all(); the tile states after it redraw their own tiles. The Guition wraps the LVGL touch read callback with cyd::GhostTouch, which repeats the previous read for a pressed (0, 0), and the edge swipe skips that sample too. Both slider handlers log a jump to an end on release. Checked with 214 Python and 14 C++ tests, generate_packages --check, and ESP32 builds of both Easy profiles. Firmware 0.2.47. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
## 0.2.55 (firmware 0.2.47)
|
||||
|
||||
A colour slider no longer turns red when you let go.
|
||||
|
||||
- **Sliders keep the value you let go of.** On a Guition, dragging a light's colour slider and letting go could send red instead of the colour under your finger, and brightness or colour temperature could jump to an end the same way. The touch panel now and then reports a stray touch in the top-left corner just as the finger lifts, and the screen took that as where the finger was. The screen now ignores it. Should a slider still jump when you let go, the ESPHome log says `slider jumped on release`.
|
||||
- **Setting a screen to what it already has costs nothing.** An automation that sets Standby after or a brightness whenever a light changes runs on every colour and brightness change too, because a state trigger without `to:` also fires on those. Each time, ESP Screens sent the whole screen again, and while the screen redrew its page it briefly stopped reading the touch panel: exactly when you were dragging that light's slider. A value the screen already has is now neither saved on the screen nor sent again by ESP Screens.
|
||||
- **A repeated layout no longer redraws the page.** The hourly repeat, and a save that changed nothing for this screen, only update the tiles whose state comes in, instead of rebuilding the whole page behind an open card.
|
||||
- Needs firmware 0.2.47: press **Update** on the screen.
|
||||
|
||||
## 0.2.54 (firmware 0.2.46)
|
||||
|
||||
The standby code, tidied after a review of Wake and Sleep.
|
||||
|
||||
@@ -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.46'
|
||||
FIRMWARE_VERSION = '0.2.47'
|
||||
# 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.
|
||||
|
||||
@@ -704,13 +704,17 @@ class Manager:
|
||||
try:
|
||||
inbox,key,value=event.get('inbox'),event.get('key'),event.get('value')
|
||||
if inbox in self.layouts:
|
||||
layout=dict(self.layouts[inbox]); settings=validate_settings(layout.get('settings',{}))
|
||||
layout=dict(self.layouts[inbox]); stored=validate_settings(layout.get('settings',{})); settings=dict(stored)
|
||||
if key not in settings: continue
|
||||
settings[key] = value=='1' if type(settings[key]) is bool else int(value)
|
||||
if key=='brightness':
|
||||
settings['standby_brightness']=min(settings['standby_brightness'],settings[key])
|
||||
settings['night_brightness']=min(settings['night_brightness'],settings[key])
|
||||
layout['settings']=validate_settings(settings);self.save(inbox,layout)
|
||||
settings=validate_settings(settings)
|
||||
# A screen reporting what it already has (an automation setting the same value on
|
||||
# every light change): saving would resend the whole screen while someone uses it.
|
||||
if settings==stored: continue
|
||||
layout['settings']=settings;self.save(inbox,layout)
|
||||
except (ValueError,TypeError): pass
|
||||
if hasattr(self.ha,'setting_events'): self.ha.setting_events.clear()
|
||||
dirty = self.take_dirty()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: ESP Screen Manager
|
||||
version: "0.2.54"
|
||||
version: "0.2.55"
|
||||
slug: esp_screen_manager
|
||||
description: Choose tiles for your CYD and Guition touchscreen, without reflashing.
|
||||
url: https://github.com/MaxGramser/homeassistant_espscreen
|
||||
|
||||
Reference in New Issue
Block a user