Skip to content

Commit f329322

Browse files
kjagielloBetaRavenerjtbandes
authored
Expose the 'multicolor' command on Hue lights (#3664)
Co-authored-by: BetaRavener <[email protected]> Co-authored-by: Jacob Bandes-Storch <[email protected]>
1 parent cac9801 commit f329322

File tree

3 files changed

+161
-2
lines changed

3 files changed

+161
-2
lines changed

zhaquirks/philips/__init__.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
from zigpy.zcl import foundation
1212
from zigpy.zcl.clusters.general import Basic
1313
from zigpy.zcl.clusters.measurement import OccupancySensing
14-
from zigpy.zcl.foundation import ZCLAttributeDef
14+
from zigpy.zcl.foundation import (
15+
BaseCommandDefs,
16+
Direction,
17+
ZCLAttributeDef,
18+
ZCLCommandDef,
19+
)
1520

1621
from zhaquirks.const import (
1722
ARGS,
@@ -340,3 +345,21 @@ class PhilipsRwlRemoteCluster(PhilipsRemoteCluster):
340345
3: Button("down", DIM_DOWN),
341346
4: Button("off", TURN_OFF),
342347
}
348+
349+
350+
class PhilipsHueLightCluster(CustomCluster):
351+
"""Philips Hue manufacturer cluster."""
352+
353+
cluster_id: Final[t.uint16_t] = 0xFC03
354+
ep_attribute: Final[str] = "philips_hue_light_cluster"
355+
name: Final[str] = "PhilipsHueLightCluster"
356+
357+
class ServerCommandDefs(BaseCommandDefs):
358+
"""Server command definitions."""
359+
360+
multicolor: Final = ZCLCommandDef(
361+
id=0x00,
362+
schema={"data": t.SerializableBytes},
363+
direction=Direction.Client_to_Server,
364+
is_manufacturer_specific=True,
365+
)

zhaquirks/philips/hue_light.py

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
"""Philips Hue devices."""
2+
3+
from zigpy.quirks.v2 import QuirkBuilder
4+
5+
from zhaquirks.philips import PHILIPS, SIGNIFY, PhilipsHueLightCluster
6+
7+
(
8+
QuirkBuilder()
9+
.applies_to(SIGNIFY, "LCX001")
10+
.applies_to(SIGNIFY, "LCX002")
11+
.applies_to(SIGNIFY, "LCX003")
12+
.applies_to(SIGNIFY, "LCX005")
13+
.applies_to(SIGNIFY, "LCX006")
14+
.friendly_name(
15+
model="Hue Play gradient lightstrip",
16+
manufacturer="Philips",
17+
)
18+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
19+
.add_to_registry()
20+
)
21+
22+
(
23+
QuirkBuilder()
24+
.applies_to(SIGNIFY, "LCX012")
25+
.applies_to(SIGNIFY, "LCX015")
26+
.applies_to(SIGNIFY, "LCX016")
27+
.applies_to(SIGNIFY, "LCX017")
28+
.friendly_name(
29+
model="Hue Festavia gradient light string",
30+
manufacturer="Philips",
31+
)
32+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
33+
.add_to_registry()
34+
)
35+
36+
(
37+
QuirkBuilder()
38+
.applies_to(SIGNIFY, "LTB003")
39+
.friendly_name(
40+
model="Hue White Ambiance BR30 E26",
41+
manufacturer="Philips",
42+
)
43+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
44+
.add_to_registry()
45+
)
46+
47+
(
48+
QuirkBuilder()
49+
.applies_to(SIGNIFY, "929003116301")
50+
.applies_to(SIGNIFY, "929003116401")
51+
.applies_to(SIGNIFY, "929003116501")
52+
.applies_to(SIGNIFY, "929003116601")
53+
.friendly_name(
54+
model="Hue Perifo light tube",
55+
manufacturer="Philips",
56+
)
57+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
58+
.add_to_registry()
59+
)
60+
61+
(
62+
QuirkBuilder()
63+
.applies_to(SIGNIFY, "4080248U9")
64+
.applies_to(SIGNIFY, "915005987101")
65+
.applies_to(SIGNIFY, "915005987201")
66+
.applies_to(SIGNIFY, "915005987501")
67+
.applies_to(SIGNIFY, "915005987601")
68+
.applies_to(SIGNIFY, "915005987701")
69+
.applies_to(SIGNIFY, "915005987801")
70+
.applies_to(SIGNIFY, "929003479601")
71+
.applies_to(SIGNIFY, "929003479701")
72+
.friendly_name(
73+
model="Hue Signe gradient floor lamp",
74+
manufacturer="Philips",
75+
)
76+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
77+
.add_to_registry()
78+
)
79+
80+
(
81+
QuirkBuilder()
82+
.applies_to(SIGNIFY, "915005986901")
83+
.applies_to(SIGNIFY, "915005987001")
84+
.applies_to(SIGNIFY, "915005987401")
85+
.applies_to(SIGNIFY, "915005987301")
86+
.friendly_name(
87+
model="Hue Signe gradient table lamp",
88+
manufacturer="Philips",
89+
)
90+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
91+
.add_to_registry()
92+
)
93+
94+
(
95+
QuirkBuilder()
96+
.applies_to(SIGNIFY, "915005987901")
97+
.applies_to(SIGNIFY, "915005988001")
98+
.applies_to(SIGNIFY, "915005988101")
99+
.applies_to(SIGNIFY, "915005988201")
100+
.applies_to(SIGNIFY, "915005988401")
101+
.applies_to(SIGNIFY, "915005988501")
102+
.friendly_name(
103+
model="Hue Play gradient light tube",
104+
manufacturer="Philips",
105+
)
106+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
107+
.add_to_registry()
108+
)
109+
110+
(
111+
QuirkBuilder()
112+
.applies_to(SIGNIFY, "929003116301")
113+
.applies_to(SIGNIFY, "929003116401")
114+
.applies_to(SIGNIFY, "929003116501")
115+
.applies_to(SIGNIFY, "929003116601")
116+
.friendly_name(
117+
model="Hue Perifo light tube",
118+
manufacturer="Philips",
119+
)
120+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
121+
.add_to_registry()
122+
)
123+
124+
(
125+
QuirkBuilder()
126+
.applies_to(PHILIPS, "7602031P7")
127+
.applies_to(PHILIPS, "7602031U7")
128+
.friendly_name(
129+
model="Hue Go",
130+
manufacturer="Philips",
131+
)
132+
.replaces(PhilipsHueLightCluster, endpoint_id=11)
133+
.add_to_registry()
134+
)

zhaquirks/philips/soc001.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from zigpy.zcl.clusters.general import OnOff
77
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef
88

9+
from zhaquirks.philips import SIGNIFY
10+
911

1012
class PhilipsContactCluster(CustomCluster):
1113
"""Philips manufacturer specific cluster for contact sensor."""
@@ -60,7 +62,7 @@ def _update_attribute(self, attrid, value):
6062
# device_version=0
6163
# input_clusters=[0, 1, 3, 64518]
6264
# output_clusters=[0, 3, 6, 25]>
63-
QuirkBuilder("Signify Netherlands B.V.", "SOC001")
65+
QuirkBuilder(SIGNIFY, "SOC001")
6466
.replaces(PhilipsContactCluster, endpoint_id=2)
6567
.binary_sensor(
6668
"tamper",

0 commit comments

Comments
 (0)