Repository navigation
Add a --check mode to the devices.esphome.io importer - #3028
Conversation
--repo uses an existing devices.esphome.io checkout, --device repeats, and --check (dry run) prints each requested device's import result, as JSON with --json, and exits 1 when any would be skipped. Quoted file= fence references now resolve.
|
ESPHome Bot (@esphbot) review |
Merging this PR will not alter performance
Comparing Footnotes
|
|
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3028 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 300 300
Lines 26522 26522
=======================================
Hits 26461 26461
Misses 61 61
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.
🟡 Changes recommended
Check mode bypasses the manifest ownership check, reporting slug collisions as successfully imported with exit code 0 even though a real sync skips them.
1 open issue
What changed in this PR
Adds an import-checking CLI so devices.esphome.io CI can reuse the Device Builder importer’s rules instead of duplicating them.
Changes:
- Adds local-checkout support, repeatable device filters, and check-mode text or JSON reports with skip-based exit codes.
- Supports quoted filenames in YAML fences.
- Adds tests for reporting, filtering, missing devices, and invalid checkout paths.
| File | Description |
|---|---|
tests/test_sync_esphome_devices_check.py |
Tests the new CLI options and check reports. |
script/sync_esphome_devices.py |
Wires check mode, checkout selection, filtering, and quoted fence references. |
script/_sync_check.py |
Builds per-device results and formats text or JSON output. |
Review effort: Balanced
|
Fixed in fd91311:
ESPHome Bot (@esphbot) review |
|
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Fixed in 870a7d7: a real sync goes through ESPHome Bot (@esphbot) review |
Verified. Real sync calls |
PR Review — Add a --check mode to the devices.esphome.io importerMerge-ready. The one remaining suggestion from the last review is fixed, and I found no new issues. What the PR does well:
Needs attention:
✅ Resolved since last review (1)Previously-flagged issues verified fixed
Checklist
Automated review by Kōan (Claude) |
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.

What does this implement/fix?
Add a
--checkmode to the devices.esphome.io importer, so the devices repo's CI can ask the real importer whether a changed page would import, instead of keeping a hand-copied version of its rules.--repo PATHreads an existing devices.esphome.io checkout instead of cloning;--deviceis repeatable and filters inside_iter_devices, so only the named folders are parsed.--checkimplies--dry-run(the full-setup validation gate still runs), printsokorskip <dir>: <reason>per device ({device, imported, reason}rows with--json), and exits 1 if any requested device would be skipped. A folder without a device page counts as a skip. Quotedfile="..."fences now resolve too.script/_sync_check.py, sosync_esphome_devices.pyonly gains the CLI wiring. Overlaps Accept every target platform as a devices.esphome.io SoC family #3026 in the same file (trivial merge).Notes
Tests:
tests/test_sync_esphome_devices_check.py.tests/test_sync_esphome_devices_psram.py::test_psram_allocating_components_scans_installed_esphomefails locally on unmodified main too; it depends on which esphome is installed.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.