Skip to content

Commit ef4bc37

Browse files
committed
Add support giot.switch.v51ksm #1566 by @darkaccount
1 parent 31b4cd9 commit ef4bc37

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

custom_components/xiaomi_gateway3/core/devices.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4950,6 +4950,20 @@
49504950
MapConv("right_switch_mode", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
49514951
MapConv("power_on_state", "select", mi="2.p.3", map={0: "Default", 1: "Off", 2: "On"}),
49524952
],
4953+
}, {
4954+
13138: ["GranwinIoT", "One-Button Switch (Mesh) V5", "giot.switch.v51ksm"],
4955+
"spec": [
4956+
BaseConv("switch", "switch", mi="2.p.1"),
4957+
BaseConv("action", "sensor"),
4958+
ConstConv("action", mi="2.e.1", value=BUTTON_SINGLE),
4959+
MapConv("mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Smart Switch Mode", 3: "Toggle Switch Mode"}),
4960+
MapConv("power_on_state", "select", mi="2.p.3", map={0: "Off", 1: "On", 2: "Default"}),
4961+
MapConv("led_mode_normal", "select", mi="6.p.1", map={0: "Follow Switch State", 1: "Opposite To Switch State", 2: "Often Out State", 3: "Normally On State"}, entity=ENTITY_CONFIG),
4962+
BaseConv("backlight", "switch", mi="6.p.3"),
4963+
BoolConv("black_led_valid", "binary_sensor", mi="6.p.4"),
4964+
BaseConv("switch_sensor_on", "switch", mi="11.p.1"),
4965+
MathConv("switch_sensor_mode", "number", mi="11.p.2", min=1, max=7200),
4966+
],
49534967
}, {
49544968
"default": "mesh", # default Mesh device
49554969
"spec": [

0 commit comments

Comments
 (0)