feat: subscribe the BLE device up messages even though the device is offline (#1170)

This commit is contained in:
LiShuzhen 2025-06-24 14:03:28 +08:00
parent d659d13e49
commit 70c87184e5

View File

@ -983,13 +983,17 @@ class MIoTClient:
and self._device_list_lan[did].get('push_available', False) and self._device_list_lan[did].get('push_available', False)
): ):
from_new = 'lan' from_new = 'lan'
if ( if (
from_new is None from_new is None
and did in self._device_list_cloud and did in self._device_list_cloud
and self._device_list_cloud[did].get('online', False)
): ):
# MIoT cloud service may not publish the online state updating
# message for the BLE device.
if did.startswith('blt.'):
from_new = 'cloud' from_new = 'cloud'
elif self._device_list_cloud[did].get('online', False):
from_new = 'cloud'
if from_new == from_old: if from_new == from_old:
# No need to update # No need to update
return return