Просмотр исходного кода

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

Ivann LARUELLE 3 лет назад
Родитель
Сommit
0c74739780
1 измененных файлов с 2 добавлено и 0 удалено
  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
                 return retval
             except Exception as e:
+                for entity in self._children:
+                    entity.async_schedule_update_ha_state()
                 _LOGGER.debug(
                     f"Retrying after exception {e} ({i}/{connections})",
                 )