from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
8553: ["LianXun", "Smart Switch 8-key Mesh", "lxun.switch.sw08"],
"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="12.p.1"),
MapConv("backlight", "select", mi="5.p.1", map={0: "off", 1: "on"}),
MapConv("backlight_1", "select", mi="9.p.1", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_2", "select", mi="9.p.2", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_3", "select", mi="9.p.3", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_4", "select", mi="9.p.4", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_5", "select", mi="9.p.5", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_6", "select", mi="9.p.6", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_7", "select", mi="9.p.7", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("backlight_8", "select", mi="9.p.8", map={1: "reverse", 2: "open", 3: "close", 4: "flash"}),
MapConv("mode_1", "select", mi="10.p.1", map={1: "normal", 2: "scene", 3: "flex"}),
MapConv("mode_2", "select", mi="10.p.2", map={1: "normal", 2: "scene", 3: "flex"}),
MapConv("mode_3", "select", mi="10.p.3", map={1: "normal", 2: "scene", 3: "flex"}),
MapConv("mode_4", "select", mi="10.p.4", map={1: "normal", 2: "scene", 3: "flex"}),
BaseConv("action", "sensor"),
ConstConv("action", mi="13.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="14.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="15.e.1", value=BUTTON_3_SINGLE),
ConstConv("action", mi="16.e.1", value=BUTTON_4_SINGLE),
ConstConv("action", mi="13.e.2", value=BUTTON_1_DOUBLE),
ConstConv("action", mi="14.e.2", value=BUTTON_2_DOUBLE),
ConstConv("action", mi="15.e.2", value=BUTTON_3_DOUBLE),
ConstConv("action", mi="16.e.2", value=BUTTON_4_DOUBLE),
ConstConv("action", mi="13.e.3", value=BUTTON_1_HOLD),
ConstConv("action", mi="14.e.3", value=BUTTON_2_HOLD),
ConstConv("action", mi="15.e.3", value=BUTTON_3_HOLD),
ConstConv("action", mi="16.e.3", value=BUTTON_4_HOLD),
ConstConv("action", mi="17.e.1", value="button_5_single"),
ConstConv("action", mi="18.e.1", value="button_6_single"),
ConstConv("action", mi="19.e.1", value="button_7_single"),
ConstConv("action", mi="20.e.1", value="button_8_single"),
ConstConv("action", mi="17.e.2", value="button_5_double"),
ConstConv("action", mi="18.e.2", value="button_6_double"),
ConstConv("action", mi="19.e.2", value="button_7_double"),
ConstConv("action", mi="20.e.2", value="button_8_double"),
ConstConv("action", mi="17.e.3", value="button_5_hold"),
ConstConv("action", mi="18.e.3", value="button_6_hold"),
ConstConv("action", mi="19.e.3", value="button_7_hold"),
ConstConv("action", mi="20.e.3", value="button_8_hold"),
],
}] + DEVICES