From b40d3572305565609af23c883bcacf6180409242 Mon Sep 17 00:00:00 2001 From: Li Shuzhen Date: Wed, 31 Dec 2025 09:58:29 +0800 Subject: [PATCH] fix: update mesh offline state (#1579) --- custom_components/xiaomi_home/miot/miot_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/xiaomi_home/miot/miot_client.py b/custom_components/xiaomi_home/miot/miot_client.py index cc6520c..cd25568 100644 --- a/custom_components/xiaomi_home/miot/miot_client.py +++ b/custom_components/xiaomi_home/miot/miot_client.py @@ -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)