-
Notifications
You must be signed in to change notification settings - Fork 890
Replace Inovelli quirks with v2 quirks #3232
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
Conversation
Updating Inovelli Quirks to the new formatting, as well as update to add the leading/training edge parameter for the VZM36, but removing it from the VZM31SN per Inovelli's request.
Oooh, awesome that you're doing this! Also, there were some repo changes, so you probably need to rebase this (or merge |
This also seems to supersede this PR then: |
Looks like that was just the change from add_to_registry_v2 to QuirkBuilder being used and add_to_registry() called at the end now? If so, should be fixed now. I believe I chose the right option there on merging dev in, but if not, just let me know and I can get that sorted too. |
Yep, that's fine. Pre-commit just complains about some missing docstrings now. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3232 +/- ##
==========================================
+ Coverage 91.28% 91.44% +0.16%
==========================================
Files 339 340 +1
Lines 10967 11177 +210
==========================================
+ Hits 10011 10221 +210
Misses 956 956 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
And the custom cluster on endpoint 3 isn't replaced yet (when it exists). But we can't add |
Ooo… I wonder if we should have another implementation |
Up until seconds ago, I thought we can just update the existing one. It adds To ignore this, we can just check if the endpoint exists: But the above change is not enough. When Currently thinking about if we want to error out when Maybe we want a separate method after all? Not sure yet... EDIT: We can use the following for this PR: |
zhaquirks/inovelli/VZM31SN.py
Outdated
( | ||
QuirkBuilder("Inovelli", "VZM31-SN") | ||
.replaces(InovelliVZM31SNCluster) | ||
.replaces(InovelliVZM31SNCluster, endpoint_id=2, cluster_type=ClusterType.Client) |
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.
I think we should be able to use replace_cluster_occurrences
from zigpy/zigpy#1441 for the custom output clusters on all endpoints.
Haven't tested this, but this might work (if zigpy is new enough on the quirks repo, might need to be bumped?):
.replaces(InovelliVZM31SNCluster, endpoint_id=2, cluster_type=ClusterType.Client) | |
.replace_cluster_occurrences(InovelliVZM31SNCluster) |
(Replaces both client and server clusters by default. Set replace_server_instances=False
to only replace client clusters.)
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
just a bump to avoid closing...will get updates together this weekend! |
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.
Pull Request Overview
This PR replaces the legacy Inovelli quirks with the new v2 quirks format using the QuirkBuilder API, while also updating device parameters to meet Inovelli’s latest recommendations. Key changes include:
- Migrating VZM36, VZM35SN, VZM30SN quirks from CustomDevice definitions to chained QuirkBuilder calls.
- Introducing a new v2 quirk for VZM32SN.
- Updating test code to reference the new v2 device factory method for Inovelli quirks.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
zhaquirks/inovelli/VZM36.py | Updates VZM36 quirk using QuirkBuilder with targeted replacements for light and fan clusters. |
zhaquirks/inovelli/VZM35SN.py | Replaces legacy quirk with a v2 QuirkBuilder call using cluster occurrence replacement. |
zhaquirks/inovelli/VZM32SN.py | Introduces a new v2 quirk definition for the VZM32SN device. |
zhaquirks/inovelli/VZM30SN.py | Updates VZM30SN quirk definition with a revised docstring and v2 QuirkBuilder usage. |
tests/test_inovelli_blue.py | Adjusts the test to use the new device factory (v2 quirk) and updated cluster mapping. |
Comments suppressed due to low confidence (4)
tests/test_inovelli_blue.py:23
- Ensure that the updated test invocation using zigpy_device_from_v2_quirk properly configures the device with the correct cluster mappings for the VZM31-SN quirk.
device = zigpy_device_from_v2_quirk("Inovelli", "VZM31-SN", cluster_ids={2: {0xFC31: ClusterType.Client}})
zhaquirks/inovelli/VZM36.py:15
- Verify that using .replaces() with explicit endpoint_id and cluster_type for the fan cluster is intended and consistent with the desired replacement behavior.
.replaces(InovelliVZM36FanCluster, endpoint_id=2, cluster_type=ClusterType.Client)
zhaquirks/inovelli/VZM35SN.py:9
- Ensure that .replace_cluster_occurrences is the correct method for replacing all instances of InovelliVZM35SNCluster in this device and that its behavior aligns with the new v2 quirk requirements.
.replace_cluster_occurrences(InovelliVZM35SNCluster)
zhaquirks/inovelli/VZM30SN.py:9
- Confirm that replacing the cluster occurrences with InovelliVZM30SNCluster is correctly targeting the intended clusters for the VZM30SN device, given the new v2 quirks approach.
.replace_cluster_occurrences(InovelliVZM30SNCluster)
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.
More comments on the differences between the v1/v2 quirks.
Do note that some clusters were in INPUT_CLUSTERS
(.replaces(cluster)
is enough) and others in OUTPUT_CLUSTERS
(requires .replaces(cluster, cluster_type=ClusterType.Client)
for v2 quirks).
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Ota.cluster_id, | ||
InovelliVZM31SNCluster, | ||
], |
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.
Identify
, OnOff
, LevelControl
, and InovelliVZM31SNCluster
were added for the VZM31-SN (in InovelliVZM31SNv11
) on ep 1.
Should we also do that in the v2 quirk? Maybe not..?
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.
I think at this point, these can be ignored. That v11 signature would've only been for firmware pre v2.08, and from looking at their site, 2.08 came out way back in November of 2022.
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Ota.cluster_id, | ||
InovelliVZM31SNCluster, | ||
], |
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.
OnOff
, LevelControl
, and InovelliVZM31SNCluster
were added for the VZM31-SN (in InovelliVZM31SNv10
) on ep 1.
Should we also do that in the v2 quirk? Maybe not..?
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.
I think at this point, these can be ignored. The v11 signature would've only been for firmware pre v2.08, and from looking at their site, 2.08 came out way back in November of 2022. (this one being v10 would be before that)
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
Update VZM35-SN to include the manufacturer cluster for EP2 and 3
Since the above comment threads are becoming a bit hard to go through, I'll go over the two main points left for this PR:
|
Generated new ZHA diagnostics from the legacy diagnostics provided by @codyhackw (some already with v2 quirks) with the old v1 quirks. Then, re-generated them with the current state of the PR including the The diff between diagnostics from the old v1 quirks and the new v2 quirks is this: TheJulianJES/zha@89b7409 (make sure to load the full diff for all files, though That's where I also noticed the different for We should look over the diagnostics to make sure all changes are expected. Some are just caused by reordering of attribute definitions and are fine. Others are caused by v2 quirks no longer removing some Scenes/Group clusters. |
This has been updated in the most recent merge. Agreed re point 2 with the added clusters being output and think we're fine to leave them as-is. |
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 all looks good to me. Thanks again for the effort!
To also mention this here: One thing we can consider doing in a future PR is to move the all the device specific clusters (e.g. |
Proposed change
Updating Inovelli Quirks to the v2 formatting, as well as an update to add the leading/training edge parameter for the VZM36, but removing it from the VZM31SN per Inovelli's request (it's still configurable via button press combo at the switch, which is the recommended method).
Additional information
Checklist
pre-commit
checks pass / the code has been formatted using Black