Skip to content

Commit

Permalink
Fix idle_time converter for cgllc.motion.cgpr1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 26, 2024
1 parent e128248 commit 8e7b1a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/xiaomi_gateway3/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@
BLEMathConv("illuminance", "sensor", mi=15), # moving with illuminance data
BLEMathConv("illuminance", mi=4103), # uint24
BLEBattery2691("battery", "sensor", mi=4106, entity=ENTITY_LAZY), # battery data with bug
BaseConv("idle_time", "sensor", mi=4119), # diagnostic
BLEMathConv("idle_time", "sensor", mi=4119), # diagnostic
BLEMapConv("light", "binary_sensor", mi=4120, map={"00": False, "01": True}),
],
# "ttl": "60m", # battery every 11 min
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 @@ -367,3 +367,10 @@ def test_18051():
assert p == {"occupancy": True}
p = device.decode({"eid": 18513, "edata": "0000"})
assert p == {"has_someone_duration": 0}


def test_2691():
device = XDevice(2691)

p = device.decode({"eid": 4119, "edata": "3C000000"})
assert p == {"idle_time": 60}

0 comments on commit 8e7b1a5

Please sign in to comment.