-
Notifications
You must be signed in to change notification settings - Fork 740
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 power/energy for more Aqara (H1) switches, add devices #2784
Support power/energy for more Aqara (H1) switches, add devices #2784
Conversation
…ttonSwitchFace2` These are the only models I found online.
…2naus01` Seems to be supported
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2784 +/- ##
======================================
Coverage ? 87.34%
======================================
Files ? 285
Lines ? 8824
Branches ? 0
======================================
Hits ? 7707
Misses ? 1117
Partials ? 0 ☔ View full report in Codecov by Sentry. |
This is amazing progress !! I waited for someone to get the H1 double switch better support in ZHA! thanks. |
@danielshiloah I didn't expose the device temperature, because it's often inaccurate. I don't have these devices, so I can't check if it's also the case for them.
When using in decoupled mode? Please create a new issue and tag me (and provide the answer to that question). |
@TheJulianJES opened issue #2907 |
…#2784) * Have `OppleCluster` in `opple_remote.py` inherit `XiaomiAqaraE1Cluster` * Add `MODELS_INFO` to `XiaomiOpple2ButtonSwitchFace1`, `XiaomiOpple2ButtonSwitchFace2` These are the only models I found online. * Add power and energy support for `lumi.switch.n2aeu1`, `lumi.switch.b2naus01` Seems to be supported * Add alternative signature for `lumi.switch.n1aeu1`, support power/energy, refactor * Remove redundant `XiaomiMeteringCluster` * Use `LUMI` constant for `MODELS_INFO` * Remove cluster ID comments for opple_switch.py * Remove redundant device_automation_triggers assignment * Rename `switch_h1.py` to `switch_h1_single.py`, add comment * Add `switch_h1_double.py` and move H1 double switch quirk from `opple_switch.py` * Remove cluster ID comments from `XiaomiOpple2ButtonSwitchFace2` * Rename `lumi.switch.n2aeu1` quirk to `AqaraH1DoubleRockerSwitchWithNeutral` * Change imports slightly * Add support for `lumi.switch.l2aeu1`, `lumi.switch.l2aeu1` * Improve docstring for opple_switch.py
…#2784) * Have `OppleCluster` in `opple_remote.py` inherit `XiaomiAqaraE1Cluster` * Add `MODELS_INFO` to `XiaomiOpple2ButtonSwitchFace1`, `XiaomiOpple2ButtonSwitchFace2` These are the only models I found online. * Add power and energy support for `lumi.switch.n2aeu1`, `lumi.switch.b2naus01` Seems to be supported * Add alternative signature for `lumi.switch.n1aeu1`, support power/energy, refactor * Remove redundant `XiaomiMeteringCluster` * Use `LUMI` constant for `MODELS_INFO` * Remove cluster ID comments for opple_switch.py * Remove redundant device_automation_triggers assignment * Rename `switch_h1.py` to `switch_h1_single.py`, add comment * Add `switch_h1_double.py` and move H1 double switch quirk from `opple_switch.py` * Remove cluster ID comments from `XiaomiOpple2ButtonSwitchFace2` * Rename `lumi.switch.n2aeu1` quirk to `AqaraH1DoubleRockerSwitchWithNeutral` * Change imports slightly * Add support for `lumi.switch.l2aeu1`, `lumi.switch.l2aeu1` * Improve docstring for opple_switch.py
Proposed change
This should address multiple issues scattered throughout the repo.
XiaomiMeteringCluster
is removedlumi.switch.n1aeu1
is addedMODELS_INFO
forlumi.switch.b2naus01
,lumi.switch.n2aeu1
(XiaomiOpple2ButtonSwitchFace1
,XiaomiOpple2ButtonSwitchFace2
) is addedAdditional information
The diff is on the bigger side, but looking through the individual commits should make it clear that those "larger changes" are mostly due to refactoring. This PR isn't actually "that big".
Related:
MODELS_INFO
to all v1 quirks #2736I'm aware that the quirk for
lumi.switch.n1aeu1
changes theDEVIEC_TYPE
, but this was done for all Aqara switches. The existing quirks and custom quirks seem to do this as well, so it only makes sense to do it here as well.Checklist
pre-commit
checks pass / the code has been formatted using Black