Skip to content

Commit

Permalink
Merge pull request #1150 from flyibeat/Add-support-Yeelight-K-series
Browse files Browse the repository at this point in the history
Add support for “yeelight k series wall switch”
  • Loading branch information
AlexxIT authored Sep 20, 2023
2 parents 564ab51 + 8660ebe commit 74bb69b
Showing 1 changed file with 122 additions and 0 deletions.
122 changes: 122 additions & 0 deletions custom_components/xiaomi_gateway3/core/converters/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,128 @@
15: "sleep"
})
]
}, {
12455: ["Yeelight", "K Series Single Wall Switch", "YLYKG-0025/0020"],
"spec": [
Converter("switch", "switch", mi="2.p.1"),
MapConv("power-on-state", "select", mi="2.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless", "select", mi="2.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("indicator-light", "switch", mi="5.p.1", enabled=False),
MapConv("operatingmode", "select", mi="8.p.1", map={
1: "Top Speed Mode", 2: "Standard Mode" }, enabled=False),
Converter("action", "sensor", enabled=False),
ButtonMIConv("button", mi="14.e.1", value=1),
ButtonMIConv("button", mi="14.e.2", value=2),
ButtonMIConv("button", mi="14.e.3", value=16),
],
}, {
12456: ["Yeelight", "K Series Double Wall Switch", "YLYKG-0026/0021"],
"spec": [
Converter("channel_1", "switch", mi="2.p.1"),
MapConv("power-on-state_1", "select", mi="2.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_1", "select", mi="2.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("channel_2", "switch", mi="3.p.1"),
MapConv("power-on-state_2", "select", mi="3.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_2", "select", mi="3.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("indicator-light", "switch", mi="5.p.1", enabled=False),
MapConv("operatingmode", "select", mi="8.p.1", map={
1: "Top Speed Mode", 2: "Standard Mode" }, enabled=False),
Converter("action", "sensor", enabled=False),
ButtonMIConv("button_1", mi="14.e.1", value=1),
ButtonMIConv("button_1", mi="14.e.2", value=2),
ButtonMIConv("button_1", mi="14.e.3", value=16),
ButtonMIConv("button_2", mi="15.e.1", value=1),
ButtonMIConv("button_2", mi="15.e.2", value=2),
ButtonMIConv("button_2", mi="15.e.3", value=16),
],
}, {
12457: ["Yeelight", "K Series Triple Wall Switch", "YLYKG-0026/0021"],
"spec": [
Converter("channel_1", "switch", mi="2.p.1"),
MapConv("power-on-state_1", "select", mi="2.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_1", "select", mi="2.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("channel_2", "switch", mi="3.p.1"),
MapConv("power-on-state_2", "select", mi="3.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_2", "select", mi="3.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("channel_3", "switch", mi="4.p.1"),
MapConv("power-on-state_3", "select", mi="4.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_3", "select", mi="4.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("indicator-light", "switch", mi="5.p.1", enabled=False),
MapConv("operatingmode", "select", mi="8.p.1", map={
1: "Top Speed Mode", 2: "Standard Mode" }, enabled=False),
Converter("action", "sensor", enabled=False),
ButtonMIConv("button_1", mi="14.e.1", value=1),
ButtonMIConv("button_1", mi="14.e.2", value=2),
ButtonMIConv("button_1", mi="14.e.3", value=16),
ButtonMIConv("button_2", mi="15.e.1", value=1),
ButtonMIConv("button_2", mi="15.e.2", value=2),
ButtonMIConv("button_2", mi="15.e.3", value=16),
ButtonMIConv("button_3", mi="16.e.1", value=1),
ButtonMIConv("button_3", mi="16.e.2", value=2),
ButtonMIConv("button_3", mi="16.e.3", value=16),
],
}, {
12458: ["Yeelight", "K Series 4-Key Wall Switch", "YLYKG-0028/0023"],
"spec": [
Converter("channel_1", "switch", mi="2.p.1"),
MapConv("power-on-state_1", "select", mi="2.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_1", "select", mi="2.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("channel_2", "switch", mi="3.p.1"),
MapConv("power-on-state_2", "select", mi="3.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_2", "select", mi="3.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("channel_3", "switch", mi="4.p.1"),
MapConv("power-on-state_3", "select", mi="4.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_3", "select", mi="4.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("channel_4", "switch", mi="12.p.1"),
MapConv("power-on-state_4", "select", mi="12.p.2", map={
1: "On", 2: "Off", 3: "Default" }, enabled=False),
MapConv("wireless_4", "select", mi="12.p.3", map={
0: "default", 1: "Wireless", 2: "Wireless", 3: "Wireless"
}, enabled=False),
Converter("indicator-light", "switch", mi="5.p.1", enabled=False),
MapConv("operatingmode", "select", mi="8.p.1", map={
1: "Top Speed Mode", 2: "Standard Mode" }, enabled=False),
Converter("action", "sensor", enabled=False),
ButtonMIConv("button_1", mi="14.e.1", value=1),
ButtonMIConv("button_1", mi="14.e.2", value=2),
ButtonMIConv("button_1", mi="14.e.3", value=16),
ButtonMIConv("button_2", mi="15.e.1", value=1),
ButtonMIConv("button_2", mi="15.e.2", value=2),
ButtonMIConv("button_2", mi="15.e.3", value=16),
ButtonMIConv("button_3", mi="16.e.1", value=1),
ButtonMIConv("button_3", mi="16.e.2", value=2),
ButtonMIConv("button_3", mi="16.e.3", value=16),
ButtonMIConv("button_4", mi="17.e.1", value=1),
ButtonMIConv("button_4", mi="17.e.2", value=2),
ButtonMIConv("button_4", mi="17.e.3", value=16),
],
}, {
1945: ["Xiaomi", "Mesh Wall Switch", "DHKG01ZM"],
"spec": [
Expand Down

0 comments on commit 74bb69b

Please sign in to comment.