mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-19 16:59:36 +08:00
feat: subscribe the BLE device up messages even though the device is offline (#1170)
This commit is contained in:
parent
d659d13e49
commit
70c87184e5
@ -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)
|
|
||||||
):
|
):
|
||||||
from_new = 'cloud'
|
# MIoT cloud service may not publish the online state updating
|
||||||
|
# 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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user