fix: update mesh offline state (#1579)
Some checks failed
Tests / check-rule-format (push) Failing after 6s
Validate / validate-hassfest (push) Failing after 6s
Validate / validate-hacs (push) Failing after 11s
Validate / validate-lint (push) Failing after 5s
Validate / validate-setup (push) Failing after 8s

This commit is contained in:
Li Shuzhen
2025-12-31 09:58:29 +08:00
committed by GitHub
parent f4d591b4d3
commit b40d357230

View File

@@ -1527,6 +1527,8 @@ class MIoTClient:
if did not in filter_dids:
continue
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
device_new = gw_list.pop(did, None)
if device_new:
@@ -1540,7 +1542,7 @@ class MIoTClient:
device_old['online'] = False
# Update cache 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
self.__update_device_msg_sub(did=did)
state_old: Optional[bool] = info.get('online', None)