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:
@@ -23,16 +23,12 @@ class LayoutTests(unittest.TestCase):
|
||||
self.assertFalse(x < xx + ww and x + w > xx and y < yy + hh and y + h > yy)
|
||||
rectangles.append((x, y, w, h))
|
||||
|
||||
def test_each_tile_filters_both_events_before_side_effects(self):
|
||||
def test_runtime_binds_every_tile_and_guards_a_tap(self):
|
||||
"""The tiles are bound by the runtime; it filters a tap before anything happens."""
|
||||
for n in range(1, 11):
|
||||
start = SOURCE.index(f' id: tile{n}\n')
|
||||
next_obj = re.search(r'^ - obj:', SOURCE[start:], re.M)
|
||||
end = start + next_obj.start() if next_obj else len(SOURCE)
|
||||
block = SOURCE[start:end]
|
||||
for event in ('short_click', 'long_press'):
|
||||
match = re.search(r'on_' + event + r':\s+- if:\s+condition:\s+lambda: (.*?)\n', block)
|
||||
self.assertIsNotNone(match, (n, event))
|
||||
self.assertIn(f'cyd::touch_guard.accept(millis(), {n})', match[1])
|
||||
self.assertIn(f'runtime_tiles::bind({n - 1}, id(tile{n})', SOURCE)
|
||||
runtime = (ROOT / 'components/smart_display/runtime_tiles.h').read_text()
|
||||
self.assertIn('if (!allowed(esphome::millis(), 100 + w.index, model.tiles[w.index].entity)) return;', runtime)
|
||||
|
||||
def test_navigation_is_above_grid_but_below_modal_overlays(self):
|
||||
grid = SOURCE.index(' id: tile_scroll')
|
||||
|
||||
Reference in New Issue
Block a user