Skip to content

Use feature_priority for update entities#684

Merged
puddly merged 1 commit intozigpy:devfrom
TheJulianJES:tjj/update_entity_feature_priority
Mar 2, 2026
Merged

Use feature_priority for update entities#684
puddly merged 1 commit intozigpy:devfrom
TheJulianJES:tjj/update_entity_feature_priority

Conversation

@TheJulianJES
Copy link
Contributor

Proposed change

This introduces feature_priority for update entities.

Currently, there's an issue where both the update entity for the client OTA cluster and the one for the server OTA cluster are discovered. If there's both an in and out OTA cluster present on a device (endpoint), the unique_id will conflict, with no warnings logged. The client OTA entity class indirectly takes precedence due to definition order.

This PR changes that to have only one entity be truly discovered, making the priority more explicit: client, then server.
For all affected devices in our diagnostics, see: #683

Additional information

Note: We can also prefer the server OTA entity if that's better, without causing breaking changes in HA. The unique_id stays the same after all. But I don't know which one actually works on these devices. Client is generally the way to do it.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.51%. Comparing base (229df22) to head (4c598df).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #684   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files          62       62           
  Lines       10949    10950    +1     
=======================================
+ Hits        10677    10678    +1     
  Misses        272      272           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@puddly puddly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I wonder: does the zigpy side even work with a server-side OTA cluster? I think both were kept because discovery in the past didn't really differentiate between the two.

@TheJulianJES
Copy link
Contributor Author

TheJulianJES commented Feb 27, 2026

Hmm, no idea. We reintroduced that swapped direction matching, so I guess it should..?
Eh, but not sure if it works from zigpy -> device?

@puddly puddly merged commit b3b690c into zigpy:dev Mar 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants