소스 검색

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 11 달 전
부모
커밋
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()
         await self._device.async_refresh()
 
 
     async def async_added_to_hass(self):
     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)
         self._device.register_entity(self)
         if self._config.deprecated:
         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):
     async def async_will_remove_from_hass(self):
         await self._device.async_unregister_entity(self)
         await self._device.async_unregister_entity(self)