-
Notifications
You must be signed in to change notification settings - Fork 926
Migrate almost all v1 quirks to v2 #4499
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
base: dev
Are you sure you want to change the base?
Conversation
The Samjin quirk technically could be merged with the Centralite one once the cluster removal is given more attention.
3efa1e9 to
259e574
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #4499 +/- ##
==========================================
- Coverage 92.24% 91.57% -0.67%
==========================================
Files 369 367 -2
Lines 12094 11086 -1008
==========================================
- Hits 11156 10152 -1004
+ Misses 938 934 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| def __init__(self, *args, **kwargs): | ||
| """Init.""" | ||
| self.occupancy_bus = Bus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately still used by MotionCluster, so we can't just remove that.
Proposed change
This PR migrates almost all straightforward V1 quirks to V2. This was mostly done with an automated tool to hint LLM agents about the exact quirk
signature->replacementtransformation. This covers about half, the other half are:I don't expect this PR to be merged as-is (we could...). We can use bits and pieces of it and migrate individual manufacturers (or groups of manufacturers) at once.
Some nice APIs to have in the future:
applies_to(), for King of Fans.replaces_endpoint->modify_device_type(endpoint_id=1, device_type=zha.DeviceType.DIMMABLE_LIGHT)?.replaces(DoublingPowerConfig1CRCluster, endpoint_id=1)can likely be replaced with a hint to the underlyingPowerConfigurationcluster entity. Entity creation hints might be be a good middle ground API between quirk IDs and directly creating entities from quirks..removes()should probably be replaced with.prevent_default_entity_creation()filterthus far are.filter(lambda device: WWAH_CLUSTER_ID not in device.endpoints[1].in_clusters), in lieu of using firmware version filters._CONSTANT_ATTRIBUTEScan also be replaced with a hint to the underlying ZCL cluster entity? We really only override color mode, mireds, and feature bitmaps.Additional information
Device diagnostics
Too many and not enough.
Checklist
pre-commitchecks pass / the code has been formatted using Black