-
Notifications
You must be signed in to change notification settings - Fork 703
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
Forward Philips Hue contact sensor changes to OnOff cluster #3541
Forward Philips Hue contact sensor changes to OnOff cluster #3541
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3541 +/- ##
=======================================
Coverage 89.61% 89.62%
=======================================
Files 313 313
Lines 10218 10224 +6
=======================================
+ Hits 9157 9163 +6
Misses 1061 1061 ☔ View full report in Codecov by Sentry. |
ZHA can't setup anymore throwing this error :
|
Uh, yeah. We have an issue where custom v2 quirks will cause this when there's already a v2 quirk present for the same device.. There's a workaround (in some other issue or PR) that you can use that deletes the old SOC001 registry entry. I'll put it here later if I don't forget. |
See this workaround: #3465 (comment) from zigpy.quirks import DEVICE_REGISTRY
# other existing imports from custom quirks
# remove upstream quirk from registry
del DEVICE_REGISTRY._registry_v2[("Signify Netherlands B.V.", "SOC001")]
# add custom quirk... |
Thanks for testing! |
Proposed change
This forwards all attribute updates from the custom Hue
contact
attribute to theOnOff
cluster.The advantage is that if commands from/to the
OnOff
cluster are missed, we'll get an attribute report in (max) 15 minutes from the custom Huecontact
attribute.We do this to avoid creating another entity and causing a breaking change if we removed the
OnOff
for this device.The custom cluster is also only bound and sets up attribute reporting when running Home Assistant Core 2024.11.0 or later. Some devices may have been set up before. These devices will still work with this PR, as the
OnOff
changes are also still received.Using this approach, we also stay flexible if we do further changes to the
OnOff
entities in the future (e.g. only creating on a whitelist for supported devices, so we don't create them for remotes).cc @mguaylam
Please test the changes from this PR again, as they're slightly different. Just install
soc001.py
as a custom quirk again.Additional information
Closes #3464
Fixes #3314 (no entity for for last contact/tamper change though)
Checklist
pre-commit
checks pass / the code has been formatted using Black