from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
8553: ["Lemesh", "8 键智能复合开关 mesh 版", "lemesh.switch.sw8a01"],
"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"}),
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"),
],
},{
14470: ["Lemesh", "情景 Mesh 一键开关 Pro", "lemesh.switch.sw1f01"],
"spec": [
BaseConv("switch_1", "switch", mi="2.p.1"),
MapConv("backlight", "select", mi="5.p.1", map={0: "off", 1: "on"}),
BaseConv("action", "sensor"),
ConstConv("action", mi="13.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="13.e.2", value=BUTTON_1_DOUBLE),
ConstConv("action", mi="13.e.3", value=BUTTON_1_HOLD),
],
},{
14469: ["Lemesh", "情景 Mesh 二键开关 Pro", "lemesh.switch.sw2f01"],
"spec": [
BaseConv("switch_1", "switch", mi="2.p.1"),
BaseConv("switch_2", "switch", mi="3.p.1"),
MapConv("backlight", "select", mi="5.p.1", map={0: "off", 1: "on"}),
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="13.e.2", value=BUTTON_1_DOUBLE),
ConstConv("action", mi="14.e.2", value=BUTTON_2_DOUBLE),
ConstConv("action", mi="13.e.3", value=BUTTON_1_HOLD),
ConstConv("action", mi="14.e.3", value=BUTTON_2_HOLD),
],
},{
14468: ["Lemesh", "情景 Mesh 三键开关 Pro", "lemesh.switch.sw3f01"],
"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"),
MapConv("backlight", "select", mi="5.p.1", map={0: "off", 1: "on"}),
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="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="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),
],
},{
14460: ["Lemesh", "情景 Mesh 四键开关 Pro", "lemesh.switch.sw4f01"],
"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"}),
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),
],
}] + DEVICES