Skip to content

Commit 1f7385c

Browse files
committed
Add Philips effect cluster and enable it for Hue Go
1 parent 2a39c07 commit 1f7385c

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed

zhaquirks/philips/7602031P7.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
"""Philips Hue Go 7602031P7 device."""
2+
3+
from zigpy.profiles import zha
4+
from zigpy.quirks import CustomDevice
5+
from zigpy.zcl.clusters.general import (
6+
Basic,
7+
GreenPowerProxy,
8+
Groups,
9+
Identify,
10+
LevelControl,
11+
OnOff,
12+
Ota,
13+
Scenes,
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+
from zhaquirks.philips import (
27+
PHILIPS,
28+
PhilipsEffectCluster,
29+
)
30+
31+
32+
class Philips7602031P7(CustomDevice):
33+
"""Philips 7602031P7 device."""
34+
35+
signature = {
36+
MODELS_INFO: [
37+
(PHILIPS, "7602031P7"),
38+
],
39+
ENDPOINTS: {
40+
# <SimpleDescriptor endpoint=11 profile=260 device_type=269
41+
# device_version=1
42+
# input_clusters=[0, 3, 4, 5, 6, 8, 768, 4096, 64513, 64515]
43+
# output_clusters=[25]>
44+
11: {
45+
PROFILE_ID: zha.PROFILE_ID,
46+
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
47+
INPUT_CLUSTERS: [
48+
Basic.cluster_id,
49+
Identify.cluster_id,
50+
Groups.cluster_id,
51+
Scenes.cluster_id,
52+
OnOff.cluster_id,
53+
LevelControl.cluster_id,
54+
Color.cluster_id,
55+
LightLink.cluster_id,
56+
64513,
57+
64515,
58+
],
59+
OUTPUT_CLUSTERS: [Ota.cluster_id],
60+
},
61+
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
62+
# device_version=0
63+
# input_clusters=[]
64+
# output_clusters=[33]>
65+
242: {
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+
11: {
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+
Color.cluster_id,
87+
LightLink.cluster_id,
88+
64513,
89+
PhilipsEffectCluster,
90+
],
91+
OUTPUT_CLUSTERS: [Ota.cluster_id],
92+
},
93+
242: {
94+
PROFILE_ID: 41440,
95+
DEVICE_TYPE: 97,
96+
INPUT_CLUSTERS: [],
97+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
98+
},
99+
}
100+
}

zhaquirks/philips/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,24 @@ def send_press_event(click_count):
218218
else:
219219
action = f"{button}_{press_type}"
220220
self.listener_event(ZHA_SEND_EVENT, action, event_args)
221+
222+
223+
class PhilipsEffectCluster(CustomCluster):
224+
"""Philips effect cluster."""
225+
226+
cluster_id = 0xFC03
227+
ep_attribute = "philips_effect"
228+
229+
server_commands = {
230+
0x00: foundation.ZCLCommandDef(
231+
"set_effect",
232+
schema={
233+
"param1": t.uint8_t,
234+
"param2": t.uint8_t,
235+
"param3": t.uint8_t,
236+
"param4": t.uint8_t,
237+
},
238+
direction=foundation.Direction.Client_to_Server,
239+
is_manufacturer_specific=True,
240+
)
241+
}

0 commit comments

Comments
 (0)