From 5b1d003bb233549a323fed0fe016af4a631fafba Mon Sep 17 00:00:00 2001 From: Li Shuzhen Date: Mon, 30 Jun 2025 11:27:12 +0800 Subject: [PATCH] feat: subscribe the BLE device up messages even though the device is offline (#1207) * feat: subscribe the BLE device up messages even though the device is offline (#1170) * fix: set all BLE devices online --- custom_components/xiaomi_home/miot/miot_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/xiaomi_home/miot/miot_client.py b/custom_components/xiaomi_home/miot/miot_client.py index cdfe110..377822d 100644 --- a/custom_components/xiaomi_home/miot/miot_client.py +++ b/custom_components/xiaomi_home/miot/miot_client.py @@ -1354,6 +1354,11 @@ class MIoTClient: """Update cloud devices. NOTICE: This function will operate the cloud_list """ + # MIoT cloud service may not publish the online state updating message + # for the BLE device. Assume that all BLE devices are online. + for did, info in cloud_list.items(): + if did.startswith('blt.'): + info['online'] = True for did, info in self._device_list_cache.items(): if filter_dids and did not in filter_dids: continue