-
Notifications
You must be signed in to change notification settings - Fork 730
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
Add Niko Connected single/double switch #3701
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 #3701 +/- ##
==========================================
+ Coverage 89.89% 90.08% +0.19%
==========================================
Files 320 322 +2
Lines 10400 10601 +201
==========================================
+ Hits 9349 9550 +201
Misses 1051 1051 ☔ View full report in Codecov by Sentry. |
8a62ae6
to
a96af16
Compare
Feel free to already test and provide feedback; perhaps some points before this PR is merged. Improvements
Functionality
Any feedback on the above would be helpful! |
a96af16
to
94f896d
Compare
94f896d
to
f8c0652
Compare
f8c0652
to
84cc4d8
Compare
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'll need to go through this properly when I find some free time, but one thing:
Bus
shouldn't really be needed anymore. The docs/README really have to be updated, but I just haven't found the time yet.
You can access update_attribute
and other methods on a different cluster directly (from your current cluster) using something like this:
zha-device-handlers/zhaquirks/xiaomi/aqara/motion_agl1.py
Lines 137 to 140 in b15a6dc
self.endpoint.ias_zone.update_attribute( | |
IasZone.AttributeDefs.zone_status.id, | |
IasZone.ZoneStatus.Alarm_1 if value == AqaraMotion.Moving else 0, | |
) |
You can also call methods on a different endpoint with
self.endpoint.device.endpoints[2].ias_zone.do_something()
for example (IIRC).
ias_zone
is the ep_attribute
of a cluster. You can also access it with self.endpoint.in_clusters[IasZone.cluster_id]
e.g.
Doing this might avoid needing some of the tasks? Again, I have to look at this properly some time soon, but it seems a bit weird looking at it now.
Same goes for the inheritance with NikoCluster
/the other Niko clusters.
And the NikoQuirkBuilder
also is a bit out of the usual pattern that we wanted to have with "quirks v2", though I see why you're doing it.
Again, this isn't a review. Just some thoughts whilst having a very quick look at this.
Not sure why apply_custom_configuration
wouldn't be working.. Your HA version is somewhat up-do-date?
You could also try overriding it in the CustomDeviceV2
class: https://github.com/zigpy/zigpy/blob/08f8f99df3d235aa0c0154331cb7c5b3dffde3e1/zigpy/quirks/__init__.py#L119-L137
The same quirk also appears to work fine with the NIKO zigbee dimmer:
|
Proposed change
Add support for the Niko Connected single switch (
552-721X1
) and Connected double switch (552-721X2
).Additional information
Request and previous work
Functionality
Events
Configuration
Checklist
pre-commit
checks pass / the code has been formatted using Black