Repository navigation
Keep unit pickers and sibling platform refinements out of the catalog sync - #3013
Conversation
|
ESPHome Bot (@esphbot) review |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3013 +/- ##
=======================================
Coverage 99.76% 99.76%
=======================================
Files 300 300
Lines 26388 26388
=======================================
Hits 26326 26326
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.
There was a problem hiding this comment.
🟡 Changes recommended
The merge comparison misses sibling type leakage when an initial templatable-only refinement is later upgraded to float, incorrectly retyping a platform’s string field.
1 open issue
What changed in this PR
This PR corrects catalog-sync type inference so unit pickers and sibling platform schemas do not introduce inappropriate field types or ranges. Catalog regeneration is deferred to a follow-up refresh of #3010.
Changes:
- Require name-matched unit validators to accept a unit-suffixed number before applying a unit-aware numeric type.
- Extend platform-specific filtering to remove or replace conflicting sibling refinements and ranges.
- Add regression tests for unit-picker classification and sibling refinement isolation.
| File | Description |
|---|---|
tests/test_sync_components_hex_display.py |
Adds regression coverage for unit validators and sibling platform refinements. |
script/sync_components.py |
Tightens validator classification and filters conflicting merged platform metadata. |
Review effort: Balanced
|
Addressed in e7506f2.
The same commit also fixes a third sync bug from the 2026.11 audit: 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.
|
Addressed in 1772c5a.
ESPHome Bot (@esphbot) review |
Confirmed both fixed. Comment at 5894-5895 matches contract. |
|
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Addressed in ae3bf02: ESPHome Bot (@esphbot) review |
PR Review — Keep unit pickers and sibling platform refinements out of the catalog syncReady to merge. The one suggestion from the last review is fixed in ae3bf02. What the PR does well:
No open issues. Checklist
Silent Failure Analysis
🟡 **1. MEDIUM** — broad exception treated as a classification signal
|
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?
Stop the catalog sync typing template
unit_of_measurementas a temperature (°C/°F/K only), which the 2026.11.0b1 sync (#3010) shipped forsensor.templateandnumber.template, and restore the base sensor fields 2026.11's nested sensor schemas lost, by fixing three sync bugs 2026.11 exposed.cv.temperature_unit(new in 2026.11, a unit picker) stays unrefined; a platform build sheds a sibling platform's refinement or range on a key its own schema types differently (previously only hub signals were shed); nestedextendsmerge per field, so 2026.11 sensors built from mid-level schemas (ina3221'sVOLTAGE_SCHEMAand about 200 others) keep theirdevice_class/state_classoptions and integeraccuracy_decimals.script/sync_components.pyonly; no catalog in this PR. Re-run the 2026.11.0b1 sync after merge to refresh Sync component catalog from schema 2026.11.0b1 #3010.Catalog diff vs #3010 (full 2026.11.0b1 sync run locally on this branch)
sensor.template,number.template,climate.template,water_heater.templateunit_of_measurementfloat_with_unit°C/°F/Kstring, 72 unit options, custom allowedtext.template,datetime.templateinitial_valuefloatstringnumber.template,text.templatemodelambdastringnumber.tmp102temperature_high/temperature_lowfloat_with_unitnested(number entity)cv.temperatureno longer bleedstext_sensor.modbus_controllerresponse_sizerangeint_range(min=1, max=250)speaker.resamplerbits_per_samplerangepassthroughevent.motionthresholdrangeina3221channels,apc1,as734x,bh1745, ...)accuracy_decimals/state_class/device_classstring, no optionsinteger; 5 / 62 optionseffects(9), displayupdate_intervaldefault (8), i2ssample_rate(2), binary_sensordevice_class(26)No other entry changed; a re-sync after the review fixes matched this content exactly. A first attempt that skipped every named
cvvalidator also dropped realcv.temperature_with_unitrefinements (49 climate min/max temperatures); the unit-suffix probe keeps those.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.