mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-19 08:50:42 +08:00
fix: set all BLE devices online
This commit is contained in:
parent
70c87184e5
commit
a94c9ddeec
@ -983,17 +983,13 @@ 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
|
from_new = 'cloud'
|
||||||
# message for the BLE device.
|
|
||||||
if did.startswith('blt.'):
|
|
||||||
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
|
||||||
@ -1358,6 +1354,11 @@ class MIoTClient:
|
|||||||
"""Update cloud devices.
|
"""Update cloud devices.
|
||||||
NOTICE: This function will operate the cloud_list
|
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():
|
for did, info in self._device_list_cache.items():
|
||||||
if filter_dids and did not in filter_dids:
|
if filter_dids and did not in filter_dids:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user