Infer one_wire platform gpio for a platform-less source block - #1756
Conversation
Two boards (kincony_kc868_aio, kincony_kc868_uair) ship a dallas_temp whose one_wire bus never lifted: their source writes the older 'one_wire: - pin: X' form with no platform:, so _materialize_bus's platform branch bailed. Infer platform gpio when a one_wire block has a pin but no platform (gpio is the only pin-driven one_wire platform; ds2484 is i2c-bridged). Extract _block_platform to keep _materialize_bus under the complexity limit. Drop both boards from the guard's allow list; regenerated against ESPHome 2026.6.3.
PR Review — Infer one_wire platform gpio for a platform-less source blockTight, well-scoped fix that infers Strengths:
Checklist
Automated review by Kōan (Claude) |
esphbot
left a comment
There was a problem hiding this comment.
No blocking issues found.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1756 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 228 228
Lines 18203 18203
=======================================
Hits 18121 18121
Misses 82 82
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes bus lifting for imported boards whose source YAML uses the legacy platform-less one_wire syntax (one_wire: - pin: ...). It improves script/sync_esphome_devices.py so the catalog generation can infer platform: gpio in this specific case, ensuring full-setup featured configs compile and letting validate_definitions.py enforce satisfied bus dependencies without allow-listing those boards.
Changes:
- Infer
one_wireplatform asgpiowhen a platform-style bus block haspinbut noplatform. - Remove
kincony_kc868_aioandkincony_kc868_uairfrom the unsatisfied-bus allow list and regenerate their lifted catalogs (YAML + JSON bodies) with the newone_wire.gpiobus andrequires. - Add a regression test covering platform-less
one_wirelifting.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
script/sync_esphome_devices.py |
Adds _block_platform() and uses it in _materialize_bus() to infer one_wire.gpio for platform-less blocks. |
tests/test_sync_esphome_devices_bus_dep.py |
Adds regression test ensuring platform-less one_wire lifts to one_wire.gpio and stamps requires. |
script/validate_definitions.py |
Removes the two boards from _UNSATISFIED_BUS_ALLOW_LIST now that the bus can be lifted. |
esphome_device_builder/definitions/boards/kincony_kc868_uair/manifest.yaml |
Adds featured one_wire.gpio bus entry, pin occupancy, and requires for the dallas sensor. |
esphome_device_builder/definitions/boards/kincony_kc868_aio/manifest.yaml |
Adds featured one_wire.gpio bus entry, pin occupancy, and requires for the dallas sensor. |
esphome_device_builder/definitions/board_bodies/kincony_kc868_uair.json |
Regenerated body reflecting the lifted one_wire.gpio bus and requires. |
esphome_device_builder/definitions/board_bodies/kincony_kc868_aio.json |
Regenerated body reflecting the lifted one_wire.gpio bus and requires. |
What does this implement/fix?
Two imported boards (
kincony_kc868_aio,kincony_kc868_uair) ship adallas_tempsensor whoseone_wirebus was never lifted into the catalog, sothe full-setup config failed to compile. They were allow-listed by #1755 with the
note "one_wire: block omits platform:".
Root cause: their source (verified on the live devices.esphome.io pages) writes
the older
one_wire:\n - pin: GPIO27form with noplatform:key. ModernESPHome requires
one_wire: - platform: gpio\n pin: X, so_materialize_bustook the platform-style branch, found no
platform, and bailed.Fix: infer
platform: gpiofor aone_wireblock that has apinbut noplatform.gpiois the only pin-driven one_wire platform (ds2484isi2c-bridged and carries no raw
pin), so the inference is unambiguous. Pulled theplatform resolution into a small
_block_platformhelper to keep_materialize_busunder the complexity limit.The two boards are removed from the guard's
_UNSATISFIED_BUS_ALLOW_LIST; theguard then verifies the bus is actually lifted (validation stays at 0 errors).
Regenerated against ESPHome 2026.6.3 — the diff is exactly those two boards gaining
a
one_wire.gpioentry with itspinlocked and the dallas sensor'srequires.Related issue or feature (if applicable):
Types of changes
bugfixFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited.docs/ARCHITECTURE.mdand/ordocs/API.md.