Add signature variant for lumi.switch.l2aeu1 without extra endpoints#4829
Add signature variant for lumi.switch.l2aeu1 without extra endpoints#4829
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new v1 quirk signature variant for the Aqara H1 Double Rocker Switch (no neutral) lumi.switch.l2aeu1 to handle devices that expose the Opple cluster on endpoints 1/2 but omit endpoints 41/42/51, ensuring the existing quirk logic can be applied and Opple configuration remains accessible.
Changes:
- Introduce
AqaraH1DoubleRockerSwitchNoNeutralCompactsignature variant without endpoints 41/42/51. - Add a signature-matching unit test for the new variant.
- Ensure the relevant quirk module is imported in the Xiaomi test suite.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| zhaquirks/xiaomi/aqara/switch_h1_double.py | Adds the new compact signature variant for lumi.switch.l2aeu1 without extra endpoints. |
| tests/test_xiaomi.py | Adds a signature-match test covering the new compact signature variant. |
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4829 +/- ##
=======================================
Coverage 93.04% 93.04%
=======================================
Files 397 397
Lines 13248 13250 +2
=======================================
+ Hits 12327 12329 +2
Misses 921 921 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds AqaraH1DoubleRockerSwitchNoNeutralAlt2 for devices that report Alarms cluster on EP1 and MultistateInput + OppleSwitch on EP2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0c7e261 to
8c2db6a
Compare
There was a problem hiding this comment.
Pull request overview
Adds additional v1 quirk signature matching for the Aqara H1 Double Rocker Switch (no neutral) lumi.switch.l2aeu1 so the Xiaomi Opple cluster-based configuration remains available even when some firmware variants omit endpoints 41/42/51.
Changes:
- Refactors the existing no-neutral quirk into multiple numbered signature variants and adds a new signature for devices missing endpoints 41/42/51.
- Adds a new test asserting the new “no extra endpoints” signature matches the intended quirk class.
- Updates Xiaomi tests to import the new quirk module.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
zhaquirks/xiaomi/aqara/switch_h1_double.py |
Adds/renames lumi.switch.l2aeu1 signature variants, including one that matches devices without endpoints 41/42/51. |
tests/test_xiaomi.py |
Imports the quirk module and adds a signature-matching test for the new variant. |
Comments suppressed due to low confidence (1)
zhaquirks/xiaomi/aqara/switch_h1_double.py:145
- The new/renamed no-neutral quirk class names (…NoNeutral1/2/3/4) aren’t self-descriptive about what signature each one matches, and the PR description references a variant name (e.g., “...Compact”) that doesn’t exist in code. Consider using descriptive suffixes (e.g., “…NoExtraEndpoints”, “…WithExtraEndpoints”) or otherwise aligning class names with the documented variants to make future maintenance/debugging easier.
class AqaraH1DoubleRockerSwitchNoNeutral2(XiaomiOpple2ButtonSwitchBase):
"""Aqara H1 Double Rocker Switch (no neutral) alternative signature."""
signature = {
| class AqaraH1DoubleRockerSwitchNoNeutralAlt2(XiaomiOpple2ButtonSwitchBase): | ||
| """Aqara H1 Double Rocker Switch (no neutral). Alarms on EP1, Opple on EP2.""" | ||
|
|
||
| signature = { | ||
| MODELS_INFO: [(LUMI, "lumi.switch.l2aeu1")], |
There was a problem hiding this comment.
This PR’s description/title focus on adding the “Opple on EP1+EP2, no extra endpoints” signature variant, but this diff also adds a new variant for a different signature shape (“Alarms on EP1, Opple on EP2”). Either update the PR description/title to include this additional variant (and why it’s needed here vs PR #4360), or drop this extra change to keep the PR scoped to the stated variant.
| class AqaraH1DoubleRockerSwitchNoNeutralAlt2(XiaomiOpple2ButtonSwitchBase): | ||
| """Aqara H1 Double Rocker Switch (no neutral). Alarms on EP1, Opple on EP2.""" | ||
|
|
||
| signature = { | ||
| MODELS_INFO: [(LUMI, "lumi.switch.l2aeu1")], | ||
| ENDPOINTS: { | ||
| # input_clusters=[0, 2, 3, 4, 5, 6, 9], output_clusters=[10, 25] | ||
| 1: { | ||
| PROFILE_ID: zha.PROFILE_ID, | ||
| DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, | ||
| INPUT_CLUSTERS: [ | ||
| Basic.cluster_id, | ||
| DeviceTemperature.cluster_id, | ||
| Identify.cluster_id, | ||
| Groups.cluster_id, | ||
| Scenes.cluster_id, | ||
| OnOff.cluster_id, | ||
| Alarms.cluster_id, | ||
| ], | ||
| OUTPUT_CLUSTERS: [ | ||
| Time.cluster_id, | ||
| Ota.cluster_id, | ||
| ], | ||
| }, | ||
| # input_clusters=[0, 3, 4, 5, 6, 18, 64704], output_clusters=[] | ||
| 2: { | ||
| PROFILE_ID: zha.PROFILE_ID, | ||
| DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, | ||
| INPUT_CLUSTERS: [ | ||
| Basic.cluster_id, | ||
| Identify.cluster_id, | ||
| Groups.cluster_id, | ||
| Scenes.cluster_id, | ||
| OnOff.cluster_id, | ||
| MultistateInput.cluster_id, | ||
| OppleSwitchCluster.cluster_id, | ||
| ], | ||
| OUTPUT_CLUSTERS: [], | ||
| }, | ||
| 242: { | ||
| PROFILE_ID: zgp.PROFILE_ID, | ||
| DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, | ||
| INPUT_CLUSTERS: [], | ||
| OUTPUT_CLUSTERS: [ | ||
| GreenPowerProxy.cluster_id, | ||
| ], | ||
| }, | ||
| }, | ||
| } |
There was a problem hiding this comment.
A new signature variant class is introduced here, but the added test only asserts signature matching for AqaraH1DoubleRockerSwitchNoNeutral2. If this variant is intended to stay, please add a corresponding assert_signature_matches_quirk test case for AqaraH1DoubleRockerSwitchNoNeutral4 so future refactors don’t silently break matching for this signature shape.
| class AqaraH1DoubleRockerSwitchNoNeutralAlt2(XiaomiOpple2ButtonSwitchBase): | |
| """Aqara H1 Double Rocker Switch (no neutral). Alarms on EP1, Opple on EP2.""" | |
| signature = { | |
| MODELS_INFO: [(LUMI, "lumi.switch.l2aeu1")], | |
| ENDPOINTS: { | |
| # input_clusters=[0, 2, 3, 4, 5, 6, 9], output_clusters=[10, 25] | |
| 1: { | |
| PROFILE_ID: zha.PROFILE_ID, | |
| DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, | |
| INPUT_CLUSTERS: [ | |
| Basic.cluster_id, | |
| DeviceTemperature.cluster_id, | |
| Identify.cluster_id, | |
| Groups.cluster_id, | |
| Scenes.cluster_id, | |
| OnOff.cluster_id, | |
| Alarms.cluster_id, | |
| ], | |
| OUTPUT_CLUSTERS: [ | |
| Time.cluster_id, | |
| Ota.cluster_id, | |
| ], | |
| }, | |
| # input_clusters=[0, 3, 4, 5, 6, 18, 64704], output_clusters=[] | |
| 2: { | |
| PROFILE_ID: zha.PROFILE_ID, | |
| DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, | |
| INPUT_CLUSTERS: [ | |
| Basic.cluster_id, | |
| Identify.cluster_id, | |
| Groups.cluster_id, | |
| Scenes.cluster_id, | |
| OnOff.cluster_id, | |
| MultistateInput.cluster_id, | |
| OppleSwitchCluster.cluster_id, | |
| ], | |
| OUTPUT_CLUSTERS: [], | |
| }, | |
| 242: { | |
| PROFILE_ID: zgp.PROFILE_ID, | |
| DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, | |
| INPUT_CLUSTERS: [], | |
| OUTPUT_CLUSTERS: [ | |
| GreenPowerProxy.cluster_id, | |
| ], | |
| }, | |
| }, | |
| } |
Proposed change
Add a new signature variant (
AqaraH1DoubleRockerSwitchNoNeutralCompact) for the Aqara H1 Double Rocker Switch (no neutral)lumi.switch.l2aeu1.Some units report MultistateInput (
0x0012) and OppleSwitchCluster (0xfcc0) on both endpoints 1 and 2, but do not expose the additional endpoints 41, 42, and 51. Without a matching signature, the quirk is not applied and Opple cluster configuration (e.g. detached mode) is inaccessible.Additional information
Related: #4315
This is distinct from PR #4360 which adds a variant where EP1 has Alarms instead of MultistateInput/OppleSwitchCluster. This PR covers the case where both EP1 and EP2 have the Opple cluster but the extra endpoints are absent — likely due to a firmware update on the device.
Device diagnostics
zha-01KKMPDK0P0X01QZ7G3VVKYWZS-LUMI lumi.switch.l2aeu1-2e37219180dd498d0f4dd11404c1606c.json
Checklist
pre-commitchecks pass / the code has been formatted using Black