Add more sensor entity metadata fields to change_entity_metadata#1721
Add more sensor entity metadata fields to change_entity_metadata#1721
change_entity_metadata#1721Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the change_entity_metadata function to support additional sensor entity metadata fields. While the PR author's primary interest is suggested_display_precision, the implementation comprehensively adds all relevant fields including new_unit, new_divisor, new_multiplier, new_min, new_max, new_step, and new_mode.
Key Changes:
- Added 8 new metadata fields to the
ChangedEntityMetadataclass andchange_entity_metadatamethod - Enhanced test coverage to validate the new fields
- Cleaned up test assertions by removing explicit None values for better readability
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| zigpy/quirks/v2/init.py | Added 8 new metadata fields (new_suggested_display_precision, new_unit, new_divisor, new_multiplier, new_min, new_max, new_step, new_mode) to both the ChangedEntityMetadata class and the change_entity_metadata method, properly threading them through the implementation |
| tests/test_quirks_v2.py | Added comprehensive test case for the new fields and improved test assertion readability by removing unnecessary explicit None value specifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1721 +/- ##
=======================================
Coverage 99.29% 99.29%
=======================================
Files 63 63
Lines 12263 12271 +8
=======================================
+ Hits 12177 12185 +8
Misses 86 86 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I do kind of wish we'd require specifying the platform for |
suggested_display_precisionis really the only one I'm interested in using but I've added the rest as well.