Remove the primary_weight pass-through property - #876
Draft
TheJulianJES wants to merge 1 commit into
Draft
Conversation
Its only caller is the primary entity election, which already reads the raw `_attr_primary` hint directly — the election now uniformly consumes the `_attr_*` inputs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #876 +/- ##
==========================================
- Coverage 97.19% 97.19% -0.01%
==========================================
Files 57 57
Lines 10543 10540 -3
==========================================
- Hits 10247 10244 -3
Misses 296 296 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the unused primary_weight pass-through property and makes primary-entity election consume _attr_primary_weight directly.
Changes:
- Removed
BaseEntity.primary_weight. - Updated all election weight reads to use
_attr_primary_weight.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
zha/zigbee/device.py |
Reads raw primary-weight attributes during election. |
zha/application/platforms/__init__.py |
Removes the unused public property. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to a TODO in #861.
Removes the
primary_weightpass-through property. Its only caller is the primary entity election, which already reads the raw_attr_primaryhint directly — the election now uniformly consumes the_attr_*inputs.No subclass overrides the property (all set the
_attr_primary_weightclass attribute), and no other consumer exists in ZHA, HA Core, or zha-quirks. Note that this is technically a public-API removal (the property shipped since 0.0.51), but the library's real consumers never used it.