diff --git a/custom_components/xiaomi_gateway3/core/devices.py b/custom_components/xiaomi_gateway3/core/devices.py index 8f57a540..b36e3452 100644 --- a/custom_components/xiaomi_gateway3/core/devices.py +++ b/custom_components/xiaomi_gateway3/core/devices.py @@ -1978,6 +1978,11 @@ 14523: ["PTX", "BLE Wireless Switch", "090615.remote.btsw1"], "spec": [ BaseConv("action", "sensor"), + # mibeacon2 spec + ConstConv("action", mi=18956, value=BUTTON_SINGLE), + ConstConv("action", mi=18957, value=BUTTON_DOUBLE), + ConstConv("action", mi=18958, value=BUTTON_HOLD), + # miot spec ConstConv("action", mi="2.e.1012", value=BUTTON_SINGLE), ConstConv("action", mi="2.e.1013", value=BUTTON_DOUBLE), ConstConv("action", mi="2.e.1014", value=BUTTON_HOLD), diff --git a/tests/test_conv_ble.py b/tests/test_conv_ble.py index f49a5160..a379178e 100644 --- a/tests/test_conv_ble.py +++ b/tests/test_conv_ble.py @@ -321,3 +321,10 @@ def test_10249(): {"siid": 6, "eiid": 1006, "arguments": [{"piid": 1, "value": 1681029598}]} ) assert p == {"action": "doorbell", "timestamp": 1681029598} + + +def test_14523(): + device = XDevice(14523) + + p = device.decode({"eid": 18956, "edata": ""}) + assert p == {"action": "single"}