Skip to content

Commit

Permalink
Merge pull request #1336 from seanyan1994/master
Browse files Browse the repository at this point in the history
add support for devices linp.remote.k9b11, linp.switch.qt1db1, linp.sw…
  • Loading branch information
AlexxIT authored Apr 22, 2024
2 parents 9aa543d + e1c1793 commit eae6c6e
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions custom_components/xiaomi_gateway3/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,23 @@
MathConv("humidity", mi="3.p.1008", round=1),
BaseConv("battery", mi="2.p.1003"),
],
}, {
# linp.remote.k9b11
5481: ["Linptech", "Wireless Button", "k9b11"],
"spec": [
# mibeacon2 spec
BLEMapConv("action", "sensor", mi=4097, map={"000000": BUTTON_1_SINGLE, "000001": BUTTON_1_DOUBLE, "000002": BUTTON_1_HOLD, "010000": BUTTON_2_SINGLE, "010001": BUTTON_2_DOUBLE, "010002": BUTTON_2_HOLD}),
BLEByteConv("battery", "sensor", mi=18435, entity=ENTITY_LAZY), # uint8
# miot spec
ConstConv("action", mi="2.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="2.e.2", value=BUTTON_1_DOUBLE),
ConstConv("action", mi="2.e.3", value=BUTTON_1_HOLD),
ConstConv("action", mi="4.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="4.e.2", value=BUTTON_2_DOUBLE),
ConstConv("action", mi="4.e.3", value=BUTTON_2_HOLD),
BaseConv("battery", mi="3.p.1003"),
],
# "ttl": "6h" # battery every 6 hours
}, {
6473: ["Yeelight", "Double Button", "XMWXKG01YL", "yeelink.remote.contrl"],
"spec": [
Expand Down Expand Up @@ -2620,6 +2637,61 @@
ConstConv("action", mi="7.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="7.e.2", value=BUTTON_2_SINGLE),
],
}, {
15658: ["Linptech", "Single Wall Switch QT1", "linp.switch.qt1db1"],
"spec": [
BaseConv("switch", "switch", mi="2.p.1"),
BoolConv("wireless", "switch", mi="2.p.2"),
BaseConv("led", "switch", mi="11.p.1"),
BaseConv("action", "sensor"),
MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
ConstConv("action", mi="3.e.1", value=BUTTON_SINGLE),
],
}, {
15659: ["Linptech", "Double Wall Switch QT1", "linp.switch.qt1db2"],
"spec": [
BaseConv("channel_1", "switch", mi="2.p.1"),
BaseConv("channel_2", "switch", mi="3.p.1"),
BoolConv("wireless_1", "switch", mi="2.p.2"),
BoolConv("wireless_2", "switch", mi="3.p.2"),
BaseConv("led", "switch", mi="11.p.1"),
BaseConv("action", "sensor"),
MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
ConstConv("action", mi="4.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="5.e.1", value=BUTTON_2_SINGLE),
],
}, {
15660: ["Linptech", "Triple Wall Switch QT1", "linp.switch.qt1db3"],
"spec": [
BaseConv("channel_1", "switch", mi="2.p.1"),
BaseConv("channel_2", "switch", mi="3.p.1"),
BaseConv("channel_3", "switch", mi="4.p.1"),
BoolConv("wireless_1", "switch", mi="2.p.2"),
BoolConv("wireless_2", "switch", mi="3.p.2"),
BoolConv("wireless_3", "switch", mi="4.p.2"),
BaseConv("led", "switch", mi="11.p.1"),
BaseConv("action", "sensor"),
MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
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),
],
}, {
15661: ["Linptech", "Quadruple Wall Switch QT1", "linp.switch.qt1db4"],
"spec": [
BaseConv("channel_1", "switch", mi="2.p.1"),
BaseConv("channel_2", "switch", mi="3.p.1"),
BaseConv("channel_3", "switch", mi="4.p.1"),
BaseConv("channel_4", "switch", mi="5.p.1"),
BoolConv("wireless_1", "switch", mi="2.p.2"),
BoolConv("wireless_2", "switch", mi="3.p.2"),
BoolConv("wireless_3", "switch", mi="4.p.2"),
BoolConv("wireless_4", "switch", mi="5.p.2"),
BaseConv("led", "switch", mi="11.p.1"),
BaseConv("action", "sensor"),
MapConv("action", mi="6.e.1.p.1", map={1: BUTTON_1_SINGLE, 2: BUTTON_2_SINGLE, 3: BUTTON_3_SINGLE, 4: BUTTON_4_SINGLE}),
MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
],
}, {
2274: ["Linptech", "Lingpu Triple Wall Switch", "linp.switch.q3s3"],
"spec": [
Expand Down

0 comments on commit eae6c6e

Please sign in to comment.