Build every screen from one shared core plus a small file per board, the same firmware as before (0.2.84)
The two board profiles (5,000 lines each, 87 % the same text) become packages/core.yaml and one file per board under packages/boards/: the hardware, a table of 84 sizes and font sizes, 18 hooks with the lines of C++ only that board adds inside a shared lambda, and the board's own sections. packages/cyd.yaml and packages/guition.yaml keep their names and places (a screen installed from ESP Screens builds as before); home-like-2432s028.yaml and guition-4848s040.yaml become the same entries for a checkout. The firmware stays 0.2.70: the C++ ESPHome generates for each board, through the checkout profile and through the GitHub package route, was compared line by line with the old profiles' (docs/TEST_RESULTS_0284.md). tools/check_packages.py replaces tools/generate_packages.py; tools/profiles.py gives the tests and tools the three files as one; docs/PROFILES.md says how the files fit together and how a board is added. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -5,10 +5,13 @@ a slider fill rounded less than its track cost 15-20 KB per frame there, and whe
|
||||
it retries inside the frame until the task watchdog resets the board.
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / 'tools'))
|
||||
import profiles # noqa: E402
|
||||
PROFILES = ['home-like-2432s028.yaml', 'guition-4848s040.yaml', 'packages/cyd.yaml', 'packages/guition.yaml']
|
||||
HEADERS = sorted((ROOT / 'components/smart_display').glob('*.h'))
|
||||
|
||||
@@ -23,7 +26,7 @@ C_LAYER_STYLES = re.compile(r'lv_obj_set_style_(opa_layered|transform_rotation|t
|
||||
class LayerFreeTests(unittest.TestCase):
|
||||
def test_board_profiles_use_no_layer_styles(self):
|
||||
for name in PROFILES:
|
||||
text = (ROOT / name).read_text()
|
||||
text = profiles.text(name)
|
||||
self.assertEqual(YAML_LAYER_STYLES.findall(text), [], name)
|
||||
self.assertEqual(re.findall(r'^\s*clip_corner: true', text, re.M), [], name)
|
||||
|
||||
@@ -50,7 +53,7 @@ class LayerFreeTests(unittest.TestCase):
|
||||
|
||||
def test_yaml_slider_fill_keeps_the_track_radius(self):
|
||||
for name in PROFILES:
|
||||
text = (ROOT / name).read_text()
|
||||
text = profiles.text(name)
|
||||
for match in re.finditer(r'^(\s+)- (?:slider|bar):\n((?:\1 .*\n|\s*\n)+)', text, re.M):
|
||||
block, indent = match.group(2), match.group(1) + ' '
|
||||
track = re.search(r'^' + indent + r'radius: (\S+)', block, re.M)
|
||||
|
||||
Reference in New Issue
Block a user