Free memory on the CYD and drop the old manual profile (0.2.50)

The CYD restarted under load: a slider fill rounded less than its track made
LVGL draw the fill into a buffer of its own size on every redraw (15-20 KB), and
when that allocation failed the refresh retried until the task watchdog fired.
Track and fill now share one radius, and tests/test_layer_free.py keeps every
layer-making style out of the profiles, the packages and the firmware headers.

A tile keeps only the fields every card uses; climate modes, select options,
weather, sun and timer times, the media title and the vacuum rows moved to an
Extra block that exists only while a state needs one, and the state copy became
a fingerprint. runtime_tiles::model went from 24,296 to 8,216 bytes.

The manual profile that bound tiles to fixed entities in the YAML is gone:
331 TILE* substitutions, DYNAMIC_TILES/TILE_COUNT/DIRECT_ACTIONS, the 80 Home
Assistant subscriptions, its tap handlers and scripts, its own vacuum card, its
guides and helper scripts, and the five stale header copies in the repository
root that two C++ tests were compiling instead of the components. esphome config
of both Easy profiles is unchanged by that cleanup.

tile_scroll and the wake overlay no longer light up on a tap, and the debug
sensor min_free reports the lowest free heap since boot. On the bench CYD static
RAM went from 32.0% to 22.8% and free heap from 64-77 KB to about 101 KB, with
78 KB as the lowest point over thirteen hours without a restart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-16 08:06:41 +02:00
parent 79a84a4c77
commit 08197c4ae1
45 changed files with 854 additions and 12896 deletions
+22 -24
View File
@@ -7,8 +7,8 @@ docs/RELEASING.md before publishing updates. Main distributes both boards.
Every push to GitHub is a release: always also bump the add-on version in
screen_manager/config.yaml (with a CHANGELOG line), otherwise HA won't see an update.
Generate packages with tools/generate_packages.py; don't edit them by hand.
Runtime mode supports all cards in all twenty positions. The position constraints
below apply only to the old manual profiles.
A screen gets its tiles from the add-on while it runs: every card works in all
twenty positions, and no Home Assistant entity belongs in a board profile.
Preserve the data schema, protocol compatibility, unique keys, and CYD preferences.
Test updates against existing data. Don't publish an unknown storage version without
a migration. Production Ingress needs no long-lived token or public port.
@@ -16,8 +16,8 @@ a migration. Production Ingress needs no long-lived token or public port.
## Guition board
The Guition 4848S040 has a separate profile `guition-4848s040.yaml` with
480×480, ST7701S RGB, and GT911. Read docs/GUITION.md. Use its own local
`guition-device.yaml`; don't carry over the CYD layout or XPT2046 calibration.
480×480, ST7701S RGB, and GT911. Read docs/GUITION.md. Don't carry over the CYD
layout or the XPT2046 calibration.
Verify touch with tools/verify_gt911.py and keep the CYD regressions green.
Don't configure wallbox relays as part of display support.
@@ -29,23 +29,21 @@ physically tap; an agent cannot replace that with software coordinates.
## Installing a new screen
1. Identify the USB port and board variant. Use ESPHome 2026.6.2 with Python
3.11–3.14. First check whether local configuration already exists.
2. In a fresh copy, use `tools/new_device.py` to create your own `device.yaml`,
`calibration.yaml`, `secrets.yaml`. Never overwrite a working profile.
Let the owner fill in Wi-Fi locally. Don't show keys in logs/chat.
3. Flash `device.yaml` with the CLI substitution `CALIBRATION_ON_BOOT=true`.
The isolated screen shows five crosshairs and works without HA.
4. Follow docs/CALIBRATING.md: guided USB capture, fit, flash, new capture,
independent verification. Ask for physical taps per target. Wait for confirmation
that the measurement screen is actually visible; a successful build is not a flash.
5. Flash without that override. Pair with the owner's own HA via the ESPHome integration.
1. Install it from ESP Screens (docs/EASY_SETUP.md): the add-on writes the screen's
own ESPHome YAML with its name, Wi-Fi reference and unique keys, and flashes it
over USB. Identify the USB port and board variant first, and check whether a
profile for this screen already exists; never overwrite a working one.
Use ESPHome 2026.6.2 with Python 3.11-3.14. Don't show keys in logs or chat.
2. CYD: the screen shows its calibration on first boot; the owner taps the
crosshairs. `tools/calibrate.py` with docs/CALIBRATING.md is the USB route for a
panel that needs measuring; ask for physical taps per target, and wait for
confirmation that the measurement screen is visible. A successful build is not a flash.
Guition: GT911 reports pixels; verify with tools/verify_gt911.py, no ADC calibration.
3. Pair with the owner's own Home Assistant through the ESPHome integration.
Read real entity IDs and supported attributes; don't make up entities.
6. Configure every tile you use according to docs/TILES.md. The vacuum card
sits at position 6. Positions 8/10 don't have a full slider/climate binding.
Don't test real device actions without the owner's permission.
7. Go through docs/ACCEPTANCE.md and report the tests actually carried out,
limitations, and the observed stability duration.
4. Choose the tiles in ESP Screens. Don't test real device actions without the
owner's permission, and report which checks were actually carried out,
the limitations, and how long the screen stayed up.
## Code and regressions
@@ -67,12 +65,12 @@ physically tap; an agent cannot replace that with software coordinates.
layout within ~25 s. Guition: `capture_ui.py` saves the LVGL render as a PNG.
Without a screen: `tools/render_topbar.py` renders the real top-bar code for both
boards via the ESPHome host + SDL2 to `.esphome/render-topbar/out/sheet.png`.
- Share via `tools/export_bundle.py` or Git. Don't stage secrets, measurements,
binaries, logs, build caches, or local device profiles.
- Share through Git. Don't stage secrets, measurements, binaries, logs, build
caches, or local device profiles.
- No automatic firmware upload to an arbitrary connected port.
With multiple boards, first determine the intended port.
- Profiles with the same `DEVICE_NAME` (Easy Setup and manual) share
`.esphome/build/<name>`. Never compile or upload them concurrently; check
- Profiles with the same `DEVICE_NAME` share `.esphome/build/<name>`.
Never compile or upload them concurrently; check
the `firmware.bin` path in the upload log, and then the compile time via
`device_info`. A wrong profile knocks the screen out of ESP Screen Manager.