From cba59a438c9adc9b60c157daa7d1c0e45e22c8ad Mon Sep 17 00:00:00 2001 From: Joee Date: Sun, 26 Nov 2023 15:47:31 +0800 Subject: [PATCH] Support giot.switch.v3oodm --- .../core/converters/devices.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/custom_components/xiaomi_gateway3/core/converters/devices.py b/custom_components/xiaomi_gateway3/core/converters/devices.py index b5d30bb7..0a4b0038 100644 --- a/custom_components/xiaomi_gateway3/core/converters/devices.py +++ b/custom_components/xiaomi_gateway3/core/converters/devices.py @@ -3124,6 +3124,26 @@ MapConv("mode_4", "select", mi="5.p.2", map={0: "Wired And Wireless", 1: "Wireless"}), Converter("backlight", "switch", mi="8.p.1"), ], +}, { + # https://home.miot-spec.com/s/giot.plug.v3oodm + 10944: ["Unknown", "Mesh Smart Switch V3", "giot.switch.v3oodm"], + "spec": [ + Converter("switch", "switch", mi="2.p.1"), + MapConv("power_on_state", "select", mi="2.p.3", map={ + 0: "off", 1: "on", 2: "previous" + }), + + # Inching mode + BoolConv("inching_mode", "switch", mi="2.p.2"), + MapConv("inching_state", "select", mi="3.p.1", map={False: "off", True: "on"}), + MathConv("inching_time", "number", mi="3.p.2", multiply=0.5, min=1, max=7200, + step=1, round=1), + + # LED + MapConv("led", "select", mi="4.p.1", map={ + 0: "follow_switch", 1: "opposite_to_switch", 2: "off", 3: "on" + }) + ] }, { "default": "mesh", # default Mesh device "spec": [