forked from zigpy/zha-device-handlers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "power outage memory" support for Aqara ceiling light L1-350 (zig…
…py#2658) feat: add support for aqara ceiling light L1-350 (zigpy#2649) This quirk adds support for power on behavior of the device
- Loading branch information
Showing
2 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from zigpy import types as t | ||
from zigpy.profiles import zha | ||
from zigpy.zcl.clusters.general import ( | ||
Groups, | ||
Identify, | ||
LevelControl, | ||
OnOff, | ||
Ota, | ||
Scenes, | ||
Time, | ||
) | ||
from zigpy.zcl.clusters.lighting import Color | ||
|
||
from zhaquirks.const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
from zhaquirks.xiaomi import BasicCluster, XiaomiAqaraE1Cluster, XiaomiCustomDevice | ||
|
||
|
||
class OppleClusterLight(XiaomiAqaraE1Cluster): | ||
"""Add Opple cluster for power outage memory attribute.""" | ||
|
||
attributes = { | ||
0x0201: ("power_outage_memory", t.Bool, True), | ||
} | ||
|
||
|
||
class LumiLightAcn003(XiaomiCustomDevice): | ||
"""Quirk for Aqara ceiling light L1-350 also known as Xiaomi ZNXDD01LM. | ||
Provides dimmable light control with color temperature setting. | ||
This quirk adds support for power on behavior by adding the power_outage_memory attribute. | ||
""" | ||
|
||
signature = { | ||
MODELS_INFO: [ | ||
("Aqara", "lumi.light.acn003"), | ||
], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.COLOR_DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
BasicCluster.cluster_id, # 0x0000 | ||
Identify.cluster_id, # 0x0003 | ||
Groups.cluster_id, # 0x0004 | ||
Scenes.cluster_id, # 0x0005 | ||
OnOff.cluster_id, # 0x0006 | ||
LevelControl.cluster_id, # 0x0008 | ||
Color.cluster_id, # 0x0300 | ||
OppleClusterLight.cluster_id, # 0xFCC0 - manufacturer specific | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Time.cluster_id, # 0x000A | ||
Ota.cluster_id, # 0x0019 | ||
], | ||
} | ||
}, | ||
} | ||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.COLOR_DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
BasicCluster, | ||
Identify.cluster_id, # 0x0003 | ||
Groups.cluster_id, # 0x0004 | ||
Scenes.cluster_id, # 0x0005 | ||
OnOff.cluster_id, # 0x0006 | ||
LevelControl.cluster_id, # 0x0008 | ||
Color.cluster_id, # 0x0300 | ||
OppleClusterLight, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Time.cluster_id, # 0x000A | ||
Ota.cluster_id, # 0x0019 | ||
], | ||
} | ||
} | ||
} |