diff --git a/custom_components/xiaomi_gateway3/core/devices.py b/custom_components/xiaomi_gateway3/core/devices.py index c9f6ba2b..5a5aff65 100644 --- a/custom_components/xiaomi_gateway3/core/devices.py +++ b/custom_components/xiaomi_gateway3/core/devices.py @@ -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 diff --git a/tests/test_conv_ble.py b/tests/test_conv_ble.py index 847aa295..0eed6c48 100644 --- a/tests/test_conv_ble.py +++ b/tests/test_conv_ble.py @@ -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}