Skip to content

Commit 4f05960

Browse files
committed
Add HOMEd extension for long_press_ep attributes
1 parent 49791cf commit 4f05960

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

helper_scripts/make_homed_extension.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,30 @@
160160
"endpointId": switch_endpoints
161161
})
162162

163+
long_press_endpoints = list(range(switch_cnt + relay_cnt + cover_cnt + 1,
164+
switch_cnt + relay_cnt + cover_cnt + 1 + switch_cnt))
165+
data[zb_manufacturer].append({
166+
"modelNames": model_names,
167+
"exposes": ["switchAction", "longRelayMode", "relayIndex", "moveCommand", "levelMoveDirection", "levelMoveRate"],
168+
"options": {
169+
"customAttributes": {
170+
"switchAction": {"type": "enum", "clusterId": 0x0007, "attributeId": 0x0010, "dataType": 0x30, "action": True},
171+
"longRelayMode": {"type": "enum", "clusterId": 0x0007, "attributeId": 0xff01, "dataType": 0x30, "action": True},
172+
"relayIndex": {"type": "enum", "clusterId": 0x0007, "attributeId": 0xff02, "dataType": 0x20, "action": True},
173+
"levelMoveRate": {"type": "value", "clusterId": 0x0007, "attributeId": 0xff04, "dataType": 0x20, "action": True},
174+
"levelMoveDirection": {"type": "enum", "clusterId": 0x0007, "attributeId": 0xff08, "dataType": 0x30, "action": True},
175+
"moveCommand": {"type": "enum", "clusterId": 0x0007, "attributeId": 0xff09, "dataType": 0x30, "action": True},
176+
},
177+
"switchAction": {"type": "select", "enum": ["on_off", "off_on", "toggle_simple", "toggle_smart_sync", "toggle_smart_opposite"]},
178+
"longRelayMode": {"type": "select", "enum": {"0": "detached", "2": "long_press"}},
179+
"relayIndex": {"type": "select", "enum": {str(i + 1): f"relay_{i + 1}" for i in range(relay_cnt)}} if relay_cnt else {"type": "value"},
180+
"levelMoveRate": {"type": "number", "min": 1, "max": 255},
181+
"levelMoveDirection": {"type": "select", "enum": {"0": "up", "1": "down", "255": "alternate"}},
182+
"moveCommand": {"type": "select", "enum": {"1": "move", "5": "move_with_on_off"}},
183+
},
184+
"endpointId": long_press_endpoints
185+
})
186+
163187
if indicators_cnt:
164188
relay_indicator_endpoints = list(range(switch_cnt + 1, switch_cnt + 1 + indicators_cnt))
165189
data[zb_manufacturer].append({

0 commit comments

Comments
 (0)