mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-02 19:43:58 +08:00
fix: update mesh offline state (#1579)
Some checks failed
Some checks failed
This commit is contained in:
@@ -1527,6 +1527,8 @@ class MIoTClient:
|
|||||||
if did not in filter_dids:
|
if did not in filter_dids:
|
||||||
continue
|
continue
|
||||||
device_old = self._device_list_gateway.get(did, None)
|
device_old = self._device_list_gateway.get(did, None)
|
||||||
|
gw_state_old = device_old.get(
|
||||||
|
'online', False) if device_old else False
|
||||||
gw_state_new: bool = False
|
gw_state_new: bool = False
|
||||||
device_new = gw_list.pop(did, None)
|
device_new = gw_list.pop(did, None)
|
||||||
if device_new:
|
if device_new:
|
||||||
@@ -1540,7 +1542,7 @@ class MIoTClient:
|
|||||||
device_old['online'] = False
|
device_old['online'] = False
|
||||||
# Update cache group_id
|
# Update cache group_id
|
||||||
info['group_id'] = group_id
|
info['group_id'] = group_id
|
||||||
if not gw_state_new:
|
if (gw_state_old == gw_state_new) and (not gw_state_new):
|
||||||
continue
|
continue
|
||||||
self.__update_device_msg_sub(did=did)
|
self.__update_device_msg_sub(did=did)
|
||||||
state_old: Optional[bool] = info.get('online', None)
|
state_old: Optional[bool] = info.get('online', None)
|
||||||
|
|||||||
Reference in New Issue
Block a user