Remove redundant native-state declarations from sensor device types#73
Remove redundant native-state declarations from sensor device types#73Highsteads wants to merge 1 commit into
Conversation
The 11 type="sensor" device definitions that enable a native display state via their creation props (SupportsSensorValue or SupportsOnState True) still declared that same state in Devices.xml, so the Indigo client logs a "native state keys cannot be overriden (ignoring)" error per device at startup — the same issue already handled on the relay base type. Removed sensorValue from Temperature/Humidity/Illuminance/Pressure/Flow/CO2/ PM25/TVOC and onOffState from Motion/Contact/SmokeCO. matterAirQualitySensor is deliberately left untouched — it sets both Supports* props False, so there sensorValue is a legal XML-declared custom state (issue simons-plugins#56), not the native key. Full test suite green (773 passed).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis change removes explicit primary display-state definitions from multiple Matter device templates in ChangesMatter device display state cleanup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Hi Simon — small follow-on to the native-state-key cleanup you already did on the relay base type.
What
The twelve
type="sensor"device types still each declared a<State id="sensorValue">or<State id="onOffState">inDevices.xml. For the eleven where the matching creation prop isTrue(SupportsSensorValueorSupportsOnState), Indigo owns that state natively, so the client logs one error per device at startup:This PR removes those eleven redundant declarations. The native state is still created via the
display_propsyour handlers already set, so nothing changes functionally — it just clears the startup noise. Same fix you applied to the relay type, carried across to the sensors.Removed
sensorValuefrom Temperature, Humidity, Illuminance, Pressure, Flow, CO2, PM2.5, TVOC (all inheritSupportsSensorValue=Truefrom_SensorHandler)onOffStatefrom Motion, Contact, Smoke/CO (SupportsOnState=True)Deliberately left alone
matterAirQualitySensorkeeps its<State id="sensorValue">. It sets bothSupports*propsFalse, so per your issue #56 notesensorValueis a legal XML-declared custom state there rather than the native key — removing it would break it.UiDisplayStateIdlines are untouched throughout.Verification
Devices.xmlre-validates as well-formedI kept the diff surgical — happy to add the same explanatory comments you have on the relay base type if you would prefer them on the sensor types too. Thanks for the plugin.
Summary by CodeRabbit