Skip to content

Commit

Permalink
fix: add xmosb01xs as a sleepy device (#94)
Browse files Browse the repository at this point in the history
this battery device is really a sleepy device.
it won't broadcast any occupancy message unless it is changed.
  • Loading branch information
ldfandian authored Aug 28, 2024
1 parent c54b0ed commit 648c7f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/xiaomi_ble/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,5 @@ class DeviceEntry:
"RTCGQ02LM",
"MMC-W505",
"RS1BB(MI)",
"XMOSB01XS",
}
2 changes: 2 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3021,6 +3021,7 @@ def test_Xiaomi_XMOSB01XS_ILLUMINANCE():
device = XiaomiBluetoothDeviceData(bindkey=bytes.fromhex(bindkey))
assert device.supported(advertisement)
assert device.bindkey_verified
assert device.sleepy_device
assert device.update(advertisement) == SensorUpdate(
title="Occupancy Sensor 411E (XMOSB01XS)",
devices={
Expand Down Expand Up @@ -3069,6 +3070,7 @@ def test_Xiaomi_XMOSB01XS_OCCUPANCY():
device = XiaomiBluetoothDeviceData(bindkey=bytes.fromhex(bindkey))
assert device.supported(advertisement)
assert device.bindkey_verified
assert device.sleepy_device
assert device.update(advertisement) == SensorUpdate(
title="Occupancy Sensor B1BD (XMOSB01XS)",
devices={
Expand Down

0 comments on commit 648c7f8

Please sign in to comment.