From cd41782f448bee3893d516ab3425bcc8c5dd66d9 Mon Sep 17 00:00:00 2001 From: chenvd Date: Fri, 27 Dec 2024 19:50:01 +0800 Subject: [PATCH] Support for linp.remote.k9b1 --- custom_components/xiaomi_gateway3/core/devices.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/custom_components/xiaomi_gateway3/core/devices.py b/custom_components/xiaomi_gateway3/core/devices.py index 5a5aff65..ad07fa1d 100644 --- a/custom_components/xiaomi_gateway3/core/devices.py +++ b/custom_components/xiaomi_gateway3/core/devices.py @@ -1540,6 +1540,20 @@ MathConv("humidity", mi="3.p.1008", round=1), BaseConv("battery", mi="2.p.1003"), ], +}, { + # linp.remote.k9b1 + 5480: ["Linptech", "Wireless Button", "k9b1"], + "spec": [ + # mibeacon2 spec + BLEMapConv("action", "sensor", mi=4097, map={"000000": BUTTON_1_SINGLE, "000001": BUTTON_1_HOLD, "000002": BUTTON_1_DOUBLE}), + 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), + BaseConv("battery", mi="3.p.1003"), + ], + # "ttl": "6h" # battery every 6 hours }, { # linp.remote.k9b11 5481: ["Linptech", "Wireless Button", "k9b11"],