|
160 | 160 | "endpointId": switch_endpoints |
161 | 161 | }) |
162 | 162 |
|
| 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 | + |
163 | 187 | if indicators_cnt: |
164 | 188 | relay_indicator_endpoints = list(range(switch_cnt + 1, switch_cnt + 1 + indicators_cnt)) |
165 | 189 | data[zb_manufacturer].append({ |
|
0 commit comments