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

revert: HA bug #152729 workaround

Based on previous detection, all entities that were added were enabled at the
time of the async_added_to_hass call.

Instead, log the stack trace for all deprecation warnings to try to locate
the error here (entities being enabled then later disabled according to the
actual registry settings).
Jason Rumney 5 месяцев назад
Родитель
Сommit
41a4a9a545
1 измененных файлов с 1 добавлено и 3 удалено
  1. 1 3
      custom_components/tuya_local/entity.py

+ 1 - 3
custom_components/tuya_local/entity.py

@@ -115,11 +115,9 @@ class TuyaLocalEntity:
         await self._device.async_refresh()
 
     async def async_added_to_hass(self):
-        if not self.enabled or self.registry_entry is None:
-            raise HomeAssistantError("HA bug #152729")
         self._device.register_entity(self)
         if self._config.deprecated:
-            _LOGGER.warning(self._config.deprecation_message)
+            _LOGGER.warning(self._config.deprecation_message, stack_info=True)
 
     async def async_will_remove_from_hass(self):
         await self._device.async_unregister_entity(self)