Repository navigation
Add Seeed XIAO 1.47" IPS Touch Display (nRF52840) board with demo overlay - #2971
tomaszduda23 wants to merge 19 commits into
Conversation
Boards can now ship a complete starter config as boards/<id>/demo.yaml. The sync bakes it into the board body (demo_yaml) and devices/create writes it, prefixed with name/friendly_name substitutions, instead of the generated template. The new board ships a Zigbee demo (LVGL spirit level driven by the LSM6DS IMU, button indicators, RGB LED, backlight number) plus featured components and a display bundle for its onboard hardware. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The board's hardware (SPI, display, backlight PWM, I2C, IMU, LEDs) now installs through default_components; demo.yaml carries only the demo behaviour and merges on top: absent blocks append, list domains gain items, mappings gain keys, and conflicting keys or shapes raise. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
USR1/USR2 become default components like the LEDs, and the demo overlay adds on_press/on_release to them with ESPHome's `- id: !extend <id>` item form, so demo.yaml carries no pins. The overlay now merges in the create path, where defaults are resolved. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The template number and the zephyr_pwm output share HARDWARE setup priority, so the number's boot publish can reach the output before it is ready and leave the panel dark. An on_boot hook at priority -100 re-publishes the restored value (100 % on first boot). Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The generated main.cpp registers the zephyr_pwm output before the template number and setup sorting is stable, so the number's restored value (100 % on first boot) already reaches a ready output. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
Drop restore_value on the backlight number so initial_value (100 %) applies on every boot instead of a previously stored low step. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The catalog types mipi_spi's transform as the string `disabled` only (the mapping form comes from a cv.Any the schema bundle loses), so the Recommended add rejected the mirror preset as "Not a valid option". The mapping now rides the default_components override, which renders on the backend; the create path test pins it against the real catalog. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
nrf52 AUTO_LOADs zephyr, which output.zephyr_pwm depends on but no catalog entry represents, so the add form asked the user to "Add zephyr" with nothing to add. The sync now advertises such auto-loaded deps in the platform entry's provides (today: nrf52 -> zephyr), which the frontend already honours as satisfying the dependency. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
Re-synced against esphome 2026.10.0; the only change is the nrf52 entry gaining provides: [zephyr]. The auto-load pass also no longer skips deps that have their own catalog entry: a platform block satisfies whatever it auto-loads either way. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The schema bundle dumps cv.Any(one_of("disabled"), Schema) as an enum
carrying a schema; the sync kept only the enum, so a mirror/swap
mapping preset failed the add form's option check. Such fields
(transform on mipi_spi / mipi_rgb / mipi_dsi) now sync as `unknown`,
the existing YAML-only union type, and the XIAO display's mirror moves
back into its locked Recommended preset.
Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The I2C bus (D4/D5) carries the IMU, the touch controller and the header, and the SPI bus (D8/D10) is the header SPI the display sits on, so imu_i2c / lcd_spi become i2c_bus / spi_bus. Their pins are marked exposed and shared, and the unused header MISO (D9, P1.14) is listed as free. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
Presets now use the board's P<port>.<pin> labels (P1.13, not 45), the spelling the pin picker writes, so generated YAML is consistent with pins the user adds. The sync still resolves them to locked_pins. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
The onboard RGB LED (P0.26 / P0.30 / P0.06, active low) is part of the XIAO nRF52840 itself, so xiao_ble gets the same three LED switches the display board recommends, plus an "RGB LED (full setup)" bundle on both. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
xiao_ble installs its three LED switches by default and ships a demo.yaml that cycles them red, green, blue from boot. The "RGB LED (full setup)" bundle is dropped from both XIAO boards. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
Three intervals toggle the red, green and blue LEDs every 1 s, 2 s and 4 s, stepping through all eight color combinations without a script. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
Restores xiao_ble to upstream's manifest; its RGB LED featured components and LED demo continue on the xiao-nrf52840-rgb-led branch. Claude-Session: https://claude.ai/code/session_01W2jQ8Gespoc8q1aqGBiNgK
|
ESPHome Bot (@esphbot) review |
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2971 +/- ##
========================================
Coverage 99.76% 99.76%
========================================
Files 300 300
Lines 26430 26553 +123
========================================
+ Hits 26368 26491 +123
Misses 62 62
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
Drop the overlay merge's unreachable splice fallback; test extending a final item without a trailing newline, a callable platform AUTO_LOAD and the enum-or-mapping union conversion.
Add mapping keys at the block's child indent instead of a nested list's dash column, append body-less blocks the template lacks, refuse repeated or inline-valued top-level overlay keys and malformed !extend items, accept a comment on the !extend line, and surface merge conflicts on create as INTERNAL_ERROR. The sync now fails on a callable platform AUTO_LOAD instead of silently skipping it.
PR Review — Add Seeed XIAO 1.47" IPS Touch Display (nRF52840) board with demo overlayReady to merge. All findings from the previous round are fixed. Three small, non-blocking issues remain. What's fixed and done well:
Remaining suggestions:
✅ Resolved since last review (5)Previously-flagged issues verified fixed
🟢 Suggestions
1. `_insert_lines` cuts lines indented less than `src`, such as a column-0 comment inside a block
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Note No code changes since the last review ( |
What does this implement/fix?
Adds the Seeed XIAO 1.47" IPS Touch Display (nRF52840) board. New devices start from a Zigbee demo: an LVGL spirit level driven by the IMU, button indicators, an RGB LED and a backlight that boots at full brightness.
default_componentsand offered on the Recommended tab, with a "Display (full setup)" bundle. The I2C and SPI buses are namedi2c_bus/spi_busbecause they're shared with the touch controller and the XIAO header. Pins use nRF52P<port>.<pin>notation.demo.yamlis merged on top of the generated config at create time.- id: !extend <id>attaches automations to default components, so the demo carries no pins. Conflicting keys fail loudly.nrf52nowprovideszephyr, so addingoutput.zephyr_pwmno longer asks for azephyrcomponent that doesn't exist.transform(disabledor a mirror/swap mapping) syncs as a YAML-onlyunknownfield instead of a one-option select that rejected the mapping.Requires:
Types of changes
new-featureFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerated viascript/sync_components.py).definitions/README.md).🤖 Generated with Claude Code