|
"""Immax NEO 07087-2 remote control""" |
|
|
|
from zigpy.profiles import zha |
|
from zigpy.quirks import CustomDevice |
|
from zigpy.zcl.clusters.general import ( |
|
# Alarms, |
|
Basic, |
|
PowerConfiguration, |
|
Identify, |
|
Groups, |
|
Scenes, |
|
OnOff, |
|
LevelControl, |
|
Time, |
|
Ota, |
|
) |
|
from zigpy.zcl.clusters.lightlink import LightLink |
|
from zhaquirks.const import ( |
|
BUTTON, |
|
COMMAND, |
|
COMMAND_ON, |
|
COMMAND_OFF, |
|
COMMAND_MOVE, |
|
COMMAND_STEP, |
|
COMMAND_STOP, |
|
DEVICE_TYPE, |
|
DIM_DOWN, |
|
DIM_UP, |
|
ENDPOINTS, |
|
INPUT_CLUSTERS, |
|
LONG_PRESS, |
|
LONG_RELEASE, |
|
MODEL, |
|
MODELS_INFO, |
|
OUTPUT_CLUSTERS, |
|
PARAMS, |
|
PROFILE_ID, |
|
SHORT_PRESS, |
|
TURN_ON, |
|
TURN_OFF, |
|
) |
|
|
|
from zhaquirks.tuya import ( |
|
TuyaDimmerSwitch, |
|
TuyaOnOff, |
|
) |
|
|
|
class ImmaxNeo07087_2(TuyaDimmerSwitch): |
|
"""Immax NEO 07087-2 remote control with triggers.""" |
|
|
|
signature = { |
|
MODELS_INFO: [("_TYZB01_7qf81wty", "TS1001")], |
|
ENDPOINTS: { |
|
# Endpoint id=1 |
|
# in=[basic:0x0000, power:0x0001, identify:0x0003, groups:0x0004, lightlink:0x1000] |
|
# out=[ota:0x0019, time:0x000A, identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, level:0x0008, lightlink:0x1000] |
|
1: { |
|
PROFILE_ID: zha.PROFILE_ID, |
|
DEVICE_TYPE: zha.DeviceType.DIMMER_SWITCH, |
|
INPUT_CLUSTERS: [ |
|
Basic.cluster_id, # 0x0000 |
|
PowerConfiguration.cluster_id, # 0x0001 |
|
Identify.cluster_id, # 0x0003 |
|
Groups.cluster_id, # 0x0004 |
|
LightLink.cluster_id, # 0x1000 |
|
], |
|
OUTPUT_CLUSTERS: [ |
|
Ota.cluster_id, # 0x0019 |
|
Time.cluster_id, # 0x000a |
|
Identify.cluster_id, # 0x0003 |
|
Groups.cluster_id, # 0x0004 |
|
Scenes.cluster_id, # 0x0005 |
|
OnOff.cluster_id, # 0x0006 |
|
LevelControl.cluster_id, # 0x0008 |
|
LightLink.cluster_id, # 0x1000 |
|
], |
|
}, |
|
}, |
|
} |
|
|
|
replacement = { |
|
ENDPOINTS: { |
|
1: { |
|
PROFILE_ID: zha.PROFILE_ID, |
|
DEVICE_TYPE: zha.DeviceType.DIMMER_SWITCH, |
|
INPUT_CLUSTERS: [ |
|
Basic.cluster_id, # 0x0000 |
|
PowerConfiguration.cluster_id, # 0x0001 |
|
Identify.cluster_id, # 0x0003 |
|
Groups.cluster_id, # 0x0004 |
|
LightLink.cluster_id, # 0x1000 |
|
], |
|
OUTPUT_CLUSTERS: [ |
|
Ota.cluster_id, # 0x0019 |
|
Time.cluster_id, # 0x000a |
|
Identify.cluster_id, # 0x0003 |
|
Groups.cluster_id, # 0x0004 |
|
Scenes.cluster_id, # 0x0005 |
|
TuyaOnOff, |
|
LevelControl.cluster_id, # 0x0008 |
|
LightLink.cluster_id, # 0x1000 |
|
], |
|
}, |
|
}, |
|
} |
|
|
|
device_automation_triggers = { |
|
(SHORT_PRESS, TURN_ON): { |
|
COMMAND: COMMAND_ON, |
|
}, |
|
(SHORT_PRESS, TURN_OFF): { |
|
COMMAND: COMMAND_OFF, |
|
}, |
|
(SHORT_PRESS, DIM_UP): { |
|
COMMAND: COMMAND_STEP, |
|
PARAMS: { |
|
"step_mode": 0, |
|
"step_size": 51, |
|
"transition_time": 10, |
|
}, |
|
}, |
|
(SHORT_PRESS, DIM_DOWN): { |
|
COMMAND: COMMAND_STEP, |
|
PARAMS: { |
|
"step_mode": 1, |
|
"step_size": 51, |
|
"transition_time": 10, |
|
}, |
|
}, |
|
(LONG_PRESS, DIM_UP): { |
|
COMMAND: COMMAND_MOVE, |
|
PARAMS: { |
|
"move_mode": 0, |
|
"rate": 51, |
|
}, |
|
}, |
|
(LONG_PRESS, DIM_DOWN): { |
|
COMMAND: COMMAND_MOVE, |
|
PARAMS: { |
|
"move_mode": 1, |
|
"rate": 51, |
|
}, |
|
}, |
|
(LONG_RELEASE, BUTTON): { |
|
COMMAND: COMMAND_STOP, |
|
} |
|
} |