from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
# https://home.miot-spec.com/spec/huca.switch.lh1
15109: ["H+", "H+ zero fire single key switch", "huca.switch.lh1"],
"spec": [
BaseConv("action", "sensor"),
ConstConv("action", mi="5.e.1", value=BUTTON_SINGLE),
BaseConv("switch", "switch", mi="2.p.1"),
BaseConv("backlight", "switch", mi="12.p.1"), # config
MapConv("mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
]
}, {
# https://home.miot-spec.com/spec/huca.switch.lh2
15110: ["H+", "H+ zero fire double key switch", "huca.switch.lh2"],
"spec": [
BaseConv("action", "sensor"),
ConstConv("action", mi="5.e.1", value=BUTTON_1_SINGLE),
BaseConv("action", "sensor"),
ConstConv("action", mi="6.e.1", value=BUTTON_2_SINGLE),
BaseConv("switch_1", "switch", mi="2.p.1"),
BaseConv("switch_2", "switch", mi="3.p.1"),
BaseConv("backlight", "switch", mi="12.p.1"), # config
MapConv("mode_1", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
MapConv("mode_2", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
]
}, {
# https://home.miot-spec.com/spec/huca.switch.lh3
15111: ["H+", "H+ zero fire tripl key switch", "huca.switch.lh3"],
"spec": [
BaseConv("action", "sensor"),
ConstConv("action", mi="5.e.1", value=BUTTON_1_SINGLE),
BaseConv("action", "sensor"),
ConstConv("action", mi="6.e.1", value=BUTTON_2_SINGLE),
BaseConv("action", "sensor"),
ConstConv("action", mi="7.e.1", value=BUTTON_3_SINGLE),
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("backlight", "switch", mi="12.p.1"), # config
MapConv("mode_1", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
MapConv("mode_2", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
MapConv("mode_3", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Flex", 3: "Jog"}),
],
}] + DEVICES