Skip to content

Commit

Permalink
Add alternative signatures to Aqara T1 Relay (#2684)
Browse files Browse the repository at this point in the history
* Add alternative signature to Aqara T1 Relay

* Also add `lumi.switch.n0acn2`, even though unconfirmed

* Add yet another alternative signature: #1231 (comment)
  • Loading branch information
TheJulianJES authored Nov 9, 2023
1 parent 4f32cb7 commit 3fddad0
Showing 1 changed file with 128 additions and 0 deletions.
128 changes: 128 additions & 0 deletions zhaquirks/xiaomi/aqara/switch_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
Scenes,
Time,
)
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks.const import (
DEVICE_TYPE,
Expand Down Expand Up @@ -199,3 +201,129 @@ class SwitchT1Alt1(SwitchT1):
},
},
}


class SwitchT1Alt2(SwitchT1):
"""Aqara T1 relay switch with alternative signature."""

signature = {
MODELS_INFO: [(LUMI, "lumi.switch.n0agl1"), (LUMI, "lumi.switch.n0acn2")],
ENDPOINTS: {
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,
Time.cluster_id,
Metering.cluster_id,
ElectricalMeasurement.cluster_id,
OppleCluster.cluster_id,
],
OUTPUT_CLUSTERS: [
OnOff.cluster_id,
Time.cluster_id,
Ota.cluster_id,
],
},
21: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
AnalogInput.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
31: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
AnalogInput.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
41: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
MultistateInput.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [
GreenPowerProxy.cluster_id,
],
},
},
}


class SwitchT1Alt3(SwitchT1):
"""Aqara T1 relay switch with alternative signature."""

signature = {
MODELS_INFO: [(LUMI, "lumi.switch.n0agl1"), (LUMI, "lumi.switch.n0acn2")],
ENDPOINTS: {
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,
Time.cluster_id,
Metering.cluster_id,
ElectricalMeasurement.cluster_id,
OppleCluster.cluster_id,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
],
},
21: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
AnalogInput.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
31: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
AnalogInput.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
41: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
MultistateInput.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [
GreenPowerProxy.cluster_id,
],
},
},
}

0 comments on commit 3fddad0

Please sign in to comment.