from custom_components.xiaomi_gateway3.core.devices import *
# from custom_components.xiaomi_gateway3.core.converters.devices import * 旧版本代码 已弃用
DEVICES = [{
    16415: [None, "Mesh Smart Plug V6", "giot.plug.v6shsm"],
    "spec": [
        BaseConv("plug", "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),
        MapConv("led", "select", mi="4.p.1", map={0: "follow_switch", 1: "opposite_to_switch", 2: "off", 3: "on"})
    ]
}] + DEVICES