Clean up default reporting config errors#711
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts ZHA’s default attribute reporting configurations to better match the semantics of discrete vs analog attributes, avoiding misconfiguration and related runtime errors when configuring reporting on devices.
Changes:
- Switch Thermostat discrete “mode/state” attributes to a discrete reporting config (instead of analog “minimum change” configs).
- Use
REPORT_CONFIG_IMMEDIATEfor BinaryInput/BinaryOutput/BinaryValuepresent_valuereporting (instead ofREPORT_CONFIG_DEFAULT).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
zha/zigbee/cluster_handlers/hvac.py |
Updates Thermostat running_mode, running_state, system_mode (and related discrete attrs) to use a discrete reporting tuple. |
zha/zigbee/cluster_handlers/general.py |
Changes BinaryInput/BinaryOutput/BinaryValue present_value reporting to REPORT_CONFIG_IMMEDIATE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #711 +/- ##
==========================================
+ Coverage 97.51% 97.62% +0.11%
==========================================
Files 62 62
Lines 10946 10951 +5
==========================================
+ Hits 10674 10691 +17
+ Misses 272 260 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TheJulianJES
left a comment
There was a problem hiding this comment.
Looks good.
It will be fun to automatically re-set up reporting for all/affected existing devices, if we ever do that.. 😅
I ran into a few errors in our default reporting config:
REPORT_CONFIG_IMMEDIATE, notREPORT_CONFIG_DEFAULT.stateandmodeThermostat cluster attributes should use a discrete reporting config, since the "minimum change" will be ignored.