mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-07-17 21:19:10 +08:00
feat: do not subscribe BLE device online/offline state message (#1264)
This commit is contained in:
@ -994,6 +994,11 @@ class MipsCloudClient(_MipsClient):
|
|||||||
handler(
|
handler(
|
||||||
did, MIoTDeviceState.ONLINE if msg['event'] == 'online'
|
did, MIoTDeviceState.ONLINE if msg['event'] == 'online'
|
||||||
else MIoTDeviceState.OFFLINE, ctx)
|
else MIoTDeviceState.OFFLINE, ctx)
|
||||||
|
|
||||||
|
if did.startswith('blt.'):
|
||||||
|
# MIoT cloud may not publish BLE device online/offline state message.
|
||||||
|
# Do not subscribe BLE device online/offline state.
|
||||||
|
return True
|
||||||
return self.__reg_broadcast_external(
|
return self.__reg_broadcast_external(
|
||||||
topic=topic, handler=on_state_msg, handler_ctx=handler_ctx)
|
topic=topic, handler=on_state_msg, handler_ctx=handler_ctx)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user