-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support configuration of entity reporting for V2 quirks #254
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #254 +/- ##
=======================================
Coverage 96.33% 96.33%
=======================================
Files 61 61
Lines 9388 9395 +7
=======================================
+ Hits 9044 9051 +7
Misses 344 344 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
needs a rebase |
208b149
to
cb75788
Compare
@dmulcahey I've just force pushed a rebase. The tests will continue to fail however, as this patch has dependeny on the zigpy PR, so this will require a further rebase once that merges. |
My bad.. sorry for the unnecessary ping!! |
Note: this requires zigpy export for exposing this via V2 quirk API.
cb75788
to
b9267d7
Compare
I've just rebased against zigpy dependency update. All tests should now be passing. |
|
||
cluster_handler.__dict__[zha_const.REPORT_CONFIG] = reporting_config | ||
|
||
endpoint.claim_cluster_handlers([cluster_handler]) |
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.
Just noting (for myself) that claiming a cluster handler is what also makes ZHA configure and bind the cluster.
), | ||
) | ||
|
||
cluster_handler.__dict__[zha_const.REPORT_CONFIG] = reporting_config |
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.
The attributes are also added to ZCL_INIT_ATTRS
above this new code block.
If I'm looking at this correctly, we'll have them in both REPORT_CONFIG
and ZCL_INIT_ATTRS
and then have duplicates in uncached
?
zha/zha/zigbee/cluster_handlers/__init__.py
Lines 458 to 460 in 11cf9ba
cached = [a for a, cached in self.ZCL_INIT_ATTRS.items() if cached] | |
uncached = [a for a, cached in self.ZCL_INIT_ATTRS.items() if not cached] | |
uncached.extend([cfg["attr"] for cfg in self.REPORT_CONFIG]) |
We might want to move the new block before the ZCL_INIT_ATTRS
block and then check in the ZCL_INIT_ATTRS
block that they're not already in REPORT_CONFIG
OR just remove them from ZCL_INIT_ATTRS
in this line?
Hi. Thanks for coming up with a proper solution for the problem of the Ikea VINDSTYRKA sensor's VOC index not being updated. I want to say that this patch, together with my quirk (ikruglov/zha-device-handlers@c49d8e1), works well. I now have a properly updating VOC Index without workarounds, such as manually reading values. I'd be happy to submit the PR for the quirk, but I thought you may already have one. So, I'll keep it to myself, meanwhile. Thanks again. |
Proposed change
This change hooks up the V2 Quirk
report_config
option to the cluster handler created for V2 quirks. It also 'claims' the cluster, which is required for reporting and binding hooks to work upon configuration of the cluster and previously wasn't being done for V2 Quirk clusters.Additional information
Please refer to zigpy/zigpy#1490 for more information on the motivation behind this patch. This patch will need to be merged after that has been merged and zigpy dependency has been bumped.