Skip to content

Allow device cluster entities overwrite from v2 quirks #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Apr 22, 2025

Conversation

mrrstux
Copy link
Contributor

@mrrstux mrrstux commented Dec 15, 2024

Entities created by a v2 quirk should be allowed to overwrite any default generated ones.

Current patch harmonizes entities unique ids format across the component. It requires HA entities unique id migration code.

Fixes home-assistant/core#128253.

@TheJulianJES TheJulianJES changed the title Allow device cluster entities overwrite from v2 quirks. Allow device cluster entities overwrite from v2 quirks Dec 18, 2024
@mrrstux mrrstux force-pushed the quirk2-allow-entity-override branch from 6c1801c to 7a78bc9 Compare January 29, 2025 11:21
<endpoint unique id>-<cluster id>-<suffix>

Keep track of previous unique id inside BaseEntityInfo to allow
home assistant zha component to migrate existing entities.
@mrrstux mrrstux force-pushed the quirk2-allow-entity-override branch from 7a78bc9 to b9af6d2 Compare January 30, 2025 21:37
@puddly
Copy link
Contributor

puddly commented Apr 11, 2025

@mrrstux I'm going to pick this PR up to rebase it on top of dev and then deal with a bunch of corner cases for migration. Do you mind if I push commits straight to your branch? Or would you prefer I make a separate PR to supersede this one?

@mrrstux
Copy link
Contributor Author

mrrstux commented Apr 11, 2025

@puddly Yes, by all means, please take it over!

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.70%. Comparing base (6678da3) to head (90d2057).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #328      +/-   ##
==========================================
- Coverage   96.70%   96.70%   -0.01%     
==========================================
  Files          61       61              
  Lines        9874     9897      +23     
==========================================
+ Hits         9549     9571      +22     
- Misses        325      326       +1     

☔ 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.

@puddly puddly marked this pull request as ready for review April 16, 2025 17:55
@puddly
Copy link
Contributor

puddly commented Apr 16, 2025

I think this PR is ready to go for the upcoming beta.

This will affect every ZHA entity in Home Assistant so I think the Home Assistant side of this change needs a bit of a rework and to pre-compute the migration in order to perform it pseudo-atomically.

@puddly
Copy link
Contributor

puddly commented Apr 22, 2025

I've scaled back the changes in this PR to not perform any migrations: it only affects the way entities are created and adds a new attribute to entity info to hold migrations. The format for it is provisional and likely will change (likely to include a version prefix for performance reasons?).

@puddly puddly merged commit 7578aa9 into zigpy:dev Apr 22, 2025
9 checks passed
@mrrstux mrrstux deleted the quirk2-allow-entity-override branch April 24, 2025 17:27
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.

Temperature calibration range limited to -2.5..2.5°
3 participants