Skip to content

Commit 0479814

Browse files
authored
Add support for LIDL RGB+CCT bulbs (#1177)
Co-authored-by: Genna Wingert <[email protected]>
1 parent fbee5ba commit 0479814

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

zhaquirks/lidl/rgbcct.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
"""Quirk for LIDL RGB+CCT bulb."""
2+
from zigpy.profiles import zha
3+
from zigpy.quirks import CustomCluster, CustomDevice
4+
from zigpy.zcl.clusters.general import (
5+
Basic,
6+
GreenPowerProxy,
7+
Groups,
8+
Identify,
9+
LevelControl,
10+
OnOff,
11+
Ota,
12+
Scenes,
13+
Time,
14+
)
15+
from zigpy.zcl.clusters.lighting import Color
16+
from zigpy.zcl.clusters.lightlink import LightLink
17+
18+
from zhaquirks.const import (
19+
DEVICE_TYPE,
20+
ENDPOINTS,
21+
INPUT_CLUSTERS,
22+
MODELS_INFO,
23+
OUTPUT_CLUSTERS,
24+
PROFILE_ID,
25+
)
26+
27+
28+
class LidlRGBCCTColorCluster(CustomCluster, Color):
29+
"""Lidl RGB+CCT Lighting custom cluster."""
30+
31+
# Set correct capabilities to ct, xy, hs
32+
# LIDL bulbs do not correctly report this attribute (comes back as None in Home Assistant)
33+
_CONSTANT_ATTRIBUTES = {0x400A: 0b11001}
34+
35+
36+
class RGBCCTLight(CustomDevice):
37+
"""Lidl RGB+CCT Lighting device."""
38+
39+
signature = {
40+
MODELS_INFO: [("_TZ3000_dbou1ap4", "TS0505A")],
41+
ENDPOINTS: {
42+
1: {
43+
# <SimpleDescriptor endpoint=1 profile=269 device_type=268
44+
# device_version=1
45+
# input_clusters=[0, 3, 4, 5, 6, 8, 768, 4096]
46+
# output_clusters=[10, 25]
47+
PROFILE_ID: zha.PROFILE_ID,
48+
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
49+
INPUT_CLUSTERS: [
50+
Basic.cluster_id,
51+
Identify.cluster_id,
52+
Groups.cluster_id,
53+
Scenes.cluster_id,
54+
OnOff.cluster_id,
55+
LevelControl.cluster_id,
56+
Color.cluster_id,
57+
LightLink.cluster_id,
58+
],
59+
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
60+
},
61+
242: {
62+
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
63+
# device_version=0
64+
# input_clusters=[]
65+
# output_clusters=[33]
66+
PROFILE_ID: 41440,
67+
DEVICE_TYPE: 97,
68+
INPUT_CLUSTERS: [],
69+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
70+
},
71+
},
72+
}
73+
74+
replacement = {
75+
ENDPOINTS: {
76+
1: {
77+
PROFILE_ID: zha.PROFILE_ID,
78+
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
79+
INPUT_CLUSTERS: [
80+
Basic.cluster_id,
81+
Identify.cluster_id,
82+
Groups.cluster_id,
83+
Scenes.cluster_id,
84+
OnOff.cluster_id,
85+
LevelControl.cluster_id,
86+
LidlRGBCCTColorCluster,
87+
LightLink.cluster_id,
88+
],
89+
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
90+
},
91+
242: {
92+
PROFILE_ID: 41440,
93+
DEVICE_TYPE: 97,
94+
INPUT_CLUSTERS: [],
95+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
96+
},
97+
}
98+
}

0 commit comments

Comments
 (0)