Przeglądaj źródła

fix(devices): instruct home assistant to fetch device state if unavailable

Ivann LARUELLE 3 lat temu
rodzic
commit
0c74739780
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      custom_components/tuya_local/device.py

+ 2 - 0
custom_components/tuya_local/device.py

@@ -403,6 +403,8 @@ class TuyaLocalDevice(object):
                 self._api_protocol_working = True
                 self._api_protocol_working = True
                 return retval
                 return retval
             except Exception as e:
             except Exception as e:
+                for entity in self._children:
+                    entity.async_schedule_update_ha_state()
                 _LOGGER.debug(
                 _LOGGER.debug(
                     f"Retrying after exception {e} ({i}/{connections})",
                     f"Retrying after exception {e} ({i}/{connections})",
                 )
                 )