Closed meineihan closed 7 months ago
Can't confirm. I have tested this function.
Can't confirm. I have tested this function.
from custom_components.xiaomi_gateway3.core.converters.devices import *
DEVICES = [{
15660: ["Linptech", "Three key Wall Switch", "linp.switch.qt1db3"],
"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("mode_1", "select", mi="2.p.2", map={0: "wired", 1: "wireless"}),
MapConv("mode_2", "select", mi="3.p.2", map={0: "wired", 1: "wireless"}),
MapConv("mode_3", "select", mi="4.p.2", map={0: "wired", 1: "wireless"}),
BaseConv("action", "sensor"),
ConstConv("action", mi="5.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="6.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="7.e.1", value=BUTTON_3_SINGLE),
],
}] + DEVICES
Is this code correct?
It doesn't work.
But if I add this code to devices.py it works.
Devices moved: from custom_components.xiaomi_gateway3.core.devices import *
PS. My bad. Made a change to the wiki.
from custom_components.xiaomi_gateway3.core.devices import *
Great! Now it works!
could not add new devices by writing an external converter