feat: do not subscribe BLE device online/offline state message (#1264)

This commit is contained in:
Li Shuzhen
2025-07-16 13:57:43 +08:00
committed by GitHub
parent 836bd01ead
commit 925cf3b90f

View File

@ -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)