Skip to content

Commit

Permalink
Fix linp.flood.rs1bb converter for old gw fw #1337
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 1, 2024
1 parent d161b16 commit b99b74e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/xiaomi_gateway3/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,8 @@
}, {
16143: ["Linptech", "Submersion Sensor", "RS1BB", "linp.flood.rs1bb"],
"spec": [
BLEMapConv("water_leak", "binary_sensor", mi=18438, map={"00": False, "01": True}),
BLEByteConv("battery", "sensor", mi=19459),
BaseConv("water_leak", "binary_sensor", mi="2.p.1006"), # bool
BaseConv("battery", "sensor", mi="3.p.1003"), # uint8
],
Expand Down
15 changes: 15 additions & 0 deletions tests/test_conv_ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ def test_7184():
assert p == {"action": "double"}


def test_16143():
device = XDevice(16143)
assert device.market_name == "Linptech Submersion Sensor"

# https://github.com/AlexxIT/XiaomiGateway3/issues/1337
p = device.decode({"eid": 18438, "edata": "01"})
assert p == {"water_leak": True}

p = device.decode({"eid": 18438, "edata": "00"})
assert p == {"water_leak": False}

p = device.decode({"eid": 19459, "edata": "51"})
assert p == {"battery": 81}


def test_6473():
device = XDevice(6473)
assert device.market_name == "Yeelight Double Button"
Expand Down

0 comments on commit b99b74e

Please sign in to comment.