Skip to content

Commit bcfea78

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

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

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+
}

zhaquirks/philips/hue7602031P7.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 PHILIPS, PhilipsEffectCluster
27+
28+
29+
class Philips7602031P7(CustomDevice):
30+
"""Philips 7602031P7 device."""
31+
32+
signature = {
33+
MODELS_INFO: [
34+
(PHILIPS, "7602031P7"),
35+
],
36+
ENDPOINTS: {
37+
# <SimpleDescriptor endpoint=11 profile=260 device_type=269
38+
# device_version=1
39+
# input_clusters=[0, 3, 4, 5, 6, 8, 768, 4096, 64513, 64515]
40+
# output_clusters=[25]>
41+
11: {
42+
PROFILE_ID: zha.PROFILE_ID,
43+
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
44+
INPUT_CLUSTERS: [
45+
Basic.cluster_id,
46+
Identify.cluster_id,
47+
Groups.cluster_id,
48+
Scenes.cluster_id,
49+
OnOff.cluster_id,
50+
LevelControl.cluster_id,
51+
Color.cluster_id,
52+
LightLink.cluster_id,
53+
64513,
54+
64515,
55+
],
56+
OUTPUT_CLUSTERS: [Ota.cluster_id],
57+
},
58+
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
59+
# device_version=0
60+
# input_clusters=[]
61+
# output_clusters=[33]>
62+
242: {
63+
PROFILE_ID: 41440,
64+
DEVICE_TYPE: 97,
65+
INPUT_CLUSTERS: [],
66+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
67+
},
68+
},
69+
}
70+
71+
replacement = {
72+
ENDPOINTS: {
73+
11: {
74+
PROFILE_ID: zha.PROFILE_ID,
75+
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
76+
INPUT_CLUSTERS: [
77+
Basic.cluster_id,
78+
Identify.cluster_id,
79+
Groups.cluster_id,
80+
Scenes.cluster_id,
81+
OnOff.cluster_id,
82+
LevelControl.cluster_id,
83+
Color.cluster_id,
84+
LightLink.cluster_id,
85+
64513,
86+
PhilipsEffectCluster,
87+
],
88+
OUTPUT_CLUSTERS: [Ota.cluster_id],
89+
},
90+
242: {
91+
PROFILE_ID: 41440,
92+
DEVICE_TYPE: 97,
93+
INPUT_CLUSTERS: [],
94+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
95+
},
96+
}
97+
}

0 commit comments

Comments
 (0)