Skip to content

Commit

Permalink
Add support 090615.remote.btsw1 on old gateway firmwares #1463
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Oct 20, 2024
1 parent 79d41bd commit 15503ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/xiaomi_gateway3/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
7 changes: 7 additions & 0 deletions tests/test_conv_ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

0 comments on commit 15503ec

Please sign in to comment.