Skip to content

Commit

Permalink
Add topwit.switch.rzw34 mesh model #1125
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 4, 2024
1 parent 34adf85 commit dbce445
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/xiaomi_gateway3/core/converters/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
BUTTON_BOTH_23 = "button_both_23"

BUTTON_BOTH_SINGLE = "button_both_single"
BUTTON_BOTH_DOUBLE = "button_both_double"
BUTTON_BOTH_HOLD = "button_both_hold"

# https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/converters/fromZigbee.js#L4738
BUTTON = {
Expand Down
16 changes: 16 additions & 0 deletions custom_components/xiaomi_gateway3/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,22 @@
MathConv("light_off_gradient_time", "number", mi="2.p.7", multiply=0.5, min=0, max=10, entity=ENTITY_CONFIG),
MathConv("light_on_gradient_time", "number", mi="2.p.8", multiply=0.5, min=0, max=10, entity=ENTITY_CONFIG),
]
}, {
15082: ["Unknown", "Smart Quadruple Switch", "topwit.switch.rzw34"],
"spec": [
BaseConv("switch_1", "switch", mi="2.p.1"),
BaseConv("switch_2", "switch", mi="3.p.1"),
BaseConv("switch_3", "switch", mi="4.p.1"),
BaseConv("switch_4", "switch", mi="23.p.1"),
MapConv("mode_1", "select", mi="2.p.2", map={0: "off", 1: "wireless"}),
MapConv("mode_2", "select", mi="3.p.2", map={0: "off", 1: "wireless"}),
MapConv("mode_3", "select", mi="4.p.2", map={0: "off", 1: "wireless"}),
MapConv("mode_4", "select", mi="23.p.4", map={0: "off", 1: "wireless"}),
BaseConv("action", "sensor"),
MapConv("action", mi="5.e.1.p.2", map={1: BUTTON_1_SINGLE, 2: BUTTON_2_SINGLE, 3: BUTTON_3_SINGLE, 4: BUTTON_BOTH_SINGLE}),
MapConv("action", mi="5.e.2.p.2", map={1: BUTTON_1_DOUBLE, 2: BUTTON_2_DOUBLE, 3: BUTTON_3_DOUBLE, 4: BUTTON_BOTH_DOUBLE}),
MapConv("action", mi="5.e.3.p.2", map={1: BUTTON_1_HOLD, 2: BUTTON_2_HOLD, 3: BUTTON_3_HOLD, 4: BUTTON_BOTH_HOLD}),
]
}, {
"default": "mesh", # default Mesh device
"spec": [
Expand Down

0 comments on commit dbce445

Please sign in to comment.