Skip to content

Commit 925cf3b

Browse files
authored
feat: do not subscribe BLE device online/offline state message (#1264)
1 parent 836bd01 commit 925cf3b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

custom_components/xiaomi_home/miot/miot_mips.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,11 @@ def on_state_msg(topic: str, payload: str, ctx: Any) -> None:
994994
handler(
995995
did, MIoTDeviceState.ONLINE if msg['event'] == 'online'
996996
else MIoTDeviceState.OFFLINE, ctx)
997+
998+
if did.startswith('blt.'):
999+
# MIoT cloud may not publish BLE device online/offline state message.
1000+
# Do not subscribe BLE device online/offline state.
1001+
return True
9971002
return self.__reg_broadcast_external(
9981003
topic=topic, handler=on_state_msg, handler_ctx=handler_ctx)
9991004

0 commit comments

Comments
 (0)