Inherit a base's sub-blocks in the id walk so split platforms offer their nested sensor ids - #2826
Conversation
…heir nested sensor ids A block inherits its extends base's id and sub-blocks at every level; the nested leaf rule counts a class only when a platform of its domain declares it at a root, and the walk carries the refs expanded up the path so a self referential base stops. Catalog regenerated against 2026.9.0.
|
@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 #2826 +/- ##
=======================================
Coverage 99.75% 99.75%
=======================================
Files 294 294
Lines 25421 25421
=======================================
Hits 25359 25359
Misses 62 62
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
…, note the enumerated path depth
|
Thanks, all four addressed.
Also re-checked the whole regeneration mechanically: every leaf level difference across the 89 catalog files is one of |
|
@esphbot review |
Verified all four, plus your correction. Warning lands at Your One gap left. Nothing pins lvgl's shipped widget paths or |
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical recursion and test-fixture schema-resolution blockers remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
This bugfix extends catalog ID discovery through inherited sub-blocks so split platforms expose nested sensor/UART IDs while filtering non-entity paths.
Changes:
- Adds inherited ID traversal and entity-class filtering.
- Regenerates affected component and automation metadata.
- Adds regression tests and API documentation.
| File | Summary |
|---|---|
tests/test_sync_components_reference_classes.py |
Adds coverage for root entity-class filtering. |
tests/test_sync_components_provides.py |
Tests inherited provider paths; Critical (2 votes): the fixture wraps the sensor schema twice, preventing schema resolution. |
script/sync_components.py |
Implements inherited ID traversal; Critical (1 vote): recursive ancestry resolution does not propagate seen, allowing self-referential recursion. |
esphome_device_builder/definitions/components/wk2212_spi.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2212_i2c.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2204_spi.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2204_i2c.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2168_spi.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2168_i2c.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2132_spi.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/wk2132_i2c.json |
Regenerated inherited UART provider metadata. |
esphome_device_builder/definitions/components/statsd.json |
Regenerated component metadata. |
esphome_device_builder/definitions/components/packet_transport.udp.json |
Regenerated packet transport metadata. |
esphome_device_builder/definitions/components/packet_transport.uart.json |
Regenerated packet transport metadata. |
esphome_device_builder/definitions/components/packet_transport.sx127x.json |
Regenerated packet transport metadata. |
esphome_device_builder/definitions/components/packet_transport.sx126x.json |
Regenerated packet transport metadata. |
esphome_device_builder/definitions/components/packet_transport.espnow.json |
Regenerated packet transport metadata. |
esphome_device_builder/definitions/components/opentherm.json |
Regenerated component metadata. |
esphome_device_builder/definitions/components/lvgl.json |
Regenerated widget ID and provider metadata. |
esphome_device_builder/definitions/components/graph.json |
Regenerated component metadata. |
esphome_device_builder/definitions/components/binary_sensor.analog_threshold.json |
Regenerated sensor metadata. |
esphome_device_builder/definitions/automations/conditions/sensor.in_range.json |
Regenerated sensor reference metadata. |
esphome_device_builder/definitions/automations/actions/sensor.template.publish.json |
Regenerated sensor reference metadata. |
docs/API.md |
Documents inherited provider paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Review
PR Review — Inherit a base's sub-blocks in the id walk so split platforms offer their nested sensor idsMerge-ready. No code changed since the last review except a merge from main, and the two earlier non-blocking suggestions are still open. What's solid:
Still open (both non-blocking):
Checklist
ℹ️ Triage summary2 pre-existing finding(s) on unchanged code suppressed (freeze). Silent Failure Analysis
🟡 **1. MEDIUM** — silent skip of malformed input
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.

What does this implement/fix?
The id walk in
script/sync_components.pypulled only an inheritedidfrom anextendsbase, so a platform whose sub-sensor blocks live on a shared base (sensor.bme280_i2cand the other split_i2c/_spiplatforms,sensor.ina3221one level down,sensor.airthings_wave_plus) never got them intoprovides_id_paths; since #2782 filtered their hub id out ofsensorpickers they offered nothing.A block now inherits its base's
idand sub-blocks at every level; flat inherited fields still never merge, so a siblingmqtt_idis not recorded. The inherited automations and filters carry no schema node, so the walk never descends them and the whole bundle walks in under a second. The nested leaf rule in_record_id_classescounts a class only when some platform of that class's own domain declares it at its root, read once from the bundle in_root_entity_classes, sodisplay::DisplayPage(pages[].id) never becomes adisplayprovider path. The walk carries theextendsrefs expanded up the path, as_convert_config_varsdoes, which stops lvgl's self referential widget schemas.Catalog regenerated against 2026.9.0, sync wall time 86 s against an 83 s baseline. The 92 changed files: 16 split platforms plus
sensor.ina3221andsensor.airthings_wave_minigain nestedprovides_id_pathsand dropid_classes;sensor.airthings_wave_plus,ade7880,atm90e32,growatt_solar,havells_solar,ld6002b,rd03dandsdm_metergain the sub-sensor paths they inherit; the eightwk2xxx_*hubs provideuartthroughuart[].id;lvglreaches its widget ids and provideskey_provider; every remaining sensor declarer now carriessensor::Sensor, soreferences_classdrops from 99 sensor references across 51 component bodies and two automation docs. No display body gains apagespath.Checked in the dashboard with the paired frontend: a
sensor.copysource_idpicker offers the bme280 temperature, pressure and humidity ids and not the hub, and a touchscreendisplaypicker offers the display only.Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerate viascript/sync_components.pyif a sync is needed).docs/ARCHITECTURE.mdand/ordocs/API.md.