Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for “yeelight k series wall switch” #1150

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1726,6 +1726,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
Loading