Skip to content

Commit d28409c

Browse files
authored
Quirk for Sourcing&Creation EB-SB-1B smart button: add basic device automation (clusters unchanged) (#1644)
1 parent d4fbd3e commit d28409c

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Module for Sourcing & Creation devices."""
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
"""Device handler for Sourcing & Creation EB-SB-1B (Boulanger Essentielb 8009289) smart button."""
2+
3+
from zigpy.profiles import zha
4+
from zigpy.quirks import CustomDevice
5+
from zigpy.zcl.clusters.general import (
6+
Basic,
7+
Groups,
8+
Identify,
9+
LevelControl,
10+
OnOff,
11+
Ota,
12+
PowerConfiguration,
13+
)
14+
from zigpy.zcl.clusters.homeautomation import Diagnostic
15+
from zigpy.zcl.clusters.lighting import Color
16+
from zigpy.zcl.clusters.lightlink import LightLink
17+
18+
from zhaquirks.const import (
19+
CLUSTER_ID,
20+
COMMAND,
21+
COMMAND_STEP,
22+
COMMAND_STEP_COLOR_TEMP,
23+
COMMAND_STOP,
24+
DEVICE_TYPE,
25+
DOUBLE_PRESS,
26+
ENDPOINT_ID,
27+
ENDPOINTS,
28+
INPUT_CLUSTERS,
29+
LONG_PRESS,
30+
LONG_RELEASE,
31+
MODELS_INFO,
32+
OUTPUT_CLUSTERS,
33+
PROFILE_ID,
34+
SHORT_PRESS,
35+
TURN_ON,
36+
)
37+
38+
39+
class SourcingAndCreationSmartButton(CustomDevice):
40+
"""Custom device representing Sourcing & Creation smart button."""
41+
42+
signature = {
43+
# <SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=2048,
44+
# device_version=1,
45+
# input_clusters=[0, 1, 3, 2821, 4096, 64769],
46+
# output_clusters=[3, 4, 6, 8, 25, 768, 4096])>
47+
MODELS_INFO: [("Sourcing & Creation", "EB-SB-1B")],
48+
ENDPOINTS: {
49+
1: {
50+
PROFILE_ID: zha.PROFILE_ID, # 260
51+
DEVICE_TYPE: zha.DeviceType.COLOR_CONTROLLER, # 2048
52+
INPUT_CLUSTERS: [
53+
Basic.cluster_id, # 0
54+
PowerConfiguration.cluster_id, # 1
55+
Identify.cluster_id, # 3
56+
Diagnostic.cluster_id, # 2821
57+
LightLink.cluster_id, # 4096
58+
0xFD01, # 64769
59+
],
60+
OUTPUT_CLUSTERS: [
61+
Identify.cluster_id, # 3
62+
Groups.cluster_id, # 4
63+
OnOff.cluster_id, # 6
64+
LevelControl.cluster_id, # 8
65+
Ota.cluster_id, # 25
66+
Color.cluster_id, # 768
67+
LightLink.cluster_id, # 4096
68+
],
69+
}
70+
},
71+
}
72+
73+
replacement = {
74+
ENDPOINTS: {
75+
1: {
76+
PROFILE_ID: zha.PROFILE_ID,
77+
DEVICE_TYPE: zha.DeviceType.COLOR_CONTROLLER,
78+
INPUT_CLUSTERS: [
79+
Basic.cluster_id, # 0
80+
PowerConfiguration.cluster_id, # 1
81+
Identify.cluster_id, # 3
82+
Diagnostic.cluster_id, # 2821
83+
LightLink.cluster_id, # 4096
84+
0xFD01, # 64769
85+
],
86+
OUTPUT_CLUSTERS: [
87+
Identify.cluster_id, # 3
88+
Groups.cluster_id, # 4
89+
OnOff.cluster_id, # 6
90+
LevelControl.cluster_id, # 8
91+
Ota.cluster_id, # 25
92+
Color.cluster_id, # 768
93+
LightLink.cluster_id, # 4096
94+
],
95+
}
96+
},
97+
}
98+
99+
device_automation_triggers = {
100+
(SHORT_PRESS, TURN_ON): {
101+
CLUSTER_ID: 6, # OnOff.cluster_id
102+
ENDPOINT_ID: 1,
103+
},
104+
(LONG_PRESS, TURN_ON): {
105+
COMMAND: COMMAND_STEP,
106+
CLUSTER_ID: 8, # LevelControl.cluster_id
107+
ENDPOINT_ID: 1,
108+
},
109+
(LONG_RELEASE, TURN_ON): {
110+
COMMAND: COMMAND_STOP,
111+
CLUSTER_ID: 8, # LevelControl.cluster_id
112+
ENDPOINT_ID: 1,
113+
},
114+
(DOUBLE_PRESS, TURN_ON): {
115+
COMMAND: COMMAND_STEP_COLOR_TEMP,
116+
CLUSTER_ID: 768, # Color.cluster_id
117+
ENDPOINT_ID: 1,
118+
},
119+
}

0 commit comments

Comments
 (0)