XiaomiGateway3 icon indicating copy to clipboard operation
XiaomiGateway3 copied to clipboard

Add support huca.switch.lh3 & huca.switch.lh2 & huca.switch.lh1

Open 2331892928 opened this issue 8 months ago • 1 comments

Model: huca.switch.lh3 & huca.switch.lh2 & huca.switch.lh1 from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    # https://home.miot-spec.com/s/huca.switch.lh3
    15111:  ["H+", "H+ zero fire three-button switch", "huca.switch.lh3"],
    "spec": [
        BaseConv("left_switch", "switch", mi="2.p.1"),
        BaseConv("middle_switch", "switch", mi="3.p.1"),
        BaseConv("right_switch", "switch", mi="4.p.1"),
        MapConv("left_switch_mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
        MapConv("default_power_on_state", "select", mi="2.p.3", map={0: "Default", 1: "Off", 2: "On"}),
        MapConv("middle_switch_mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
        MapConv("right_switch_mode", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
    ],
  }] + DEVICES
  
DEVICES = [{
    # https://home.miot-spec.com/s/huca.switch.lh2
    15110:  ["H+", "HH+ zero fire double key switch", "huca.switch.lh2"],
    "spec": [
        BaseConv("left_switch", "switch", mi="2.p.1"),
        BaseConv("right_switch", "switch", mi="3.p.1"),
        MapConv("left_switch_mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
        MapConv("default_power_on_state", "select", mi="2.p.3", map={0: "Default", 1: "Off", 2: "On"}),
        MapConv("right_switch_mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
    ],
  }] + DEVICES
  
DEVICES = [{
    # https://home.miot-spec.com/s/huca.switch.lh1
    15109:  ["H+", "H+ zero fire single key switch", "huca.switch.lh1"],
    "spec": [
        BaseConv("switch", "switch", mi="2.p.1"),
        MapConv("mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
        MapConv("default_power_on_state", "select", mi="2.p.3", map={0: "Default", 1: "Off", 2: "On"}),
    ],
  }] + DEVICES

2331892928 avatar Mar 03 '25 18:03 2331892928

https://github.com/AlexxIT/XiaomiGateway3/issues/1544

2331892928 avatar Mar 03 '25 18:03 2331892928

https://github.com/AlexxIT/XiaomiGateway3/releases/tag/v4.1.0

AlexxIT avatar Aug 16 '25 18:08 AlexxIT