فهرست منبع

HA bug #152729: raise an error so a stack trace is output

This is to help track down where the issue is coming from, and confirm it
is really an HA issue and not something silly we are doing.
Jason Rumney 7 ماه پیش
والد
کامیت
d4c16bb9a0
1فایلهای تغییر یافته به همراه2 افزوده شده و 5 حذف شده
  1. 2 5
      custom_components/tuya_local/entity.py

+ 2 - 5
custom_components/tuya_local/entity.py

@@ -9,6 +9,7 @@ from homeassistant.const import (
     UnitOfArea,
     UnitOfArea,
     UnitOfTemperature,
     UnitOfTemperature,
 )
 )
+from homeassistant.exceptions import HomeAssistantError
 from homeassistant.helpers.entity import EntityCategory
 from homeassistant.helpers.entity import EntityCategory
 
 
 _LOGGER = logging.getLogger(__name__)
 _LOGGER = logging.getLogger(__name__)
@@ -115,11 +116,7 @@ class TuyaLocalEntity:
 
 
     async def async_added_to_hass(self):
     async def async_added_to_hass(self):
         if not self.enabled:
         if not self.enabled:
-            _LOGGER.warning(
-                "HA bug #152729: Entity %s is not enabled, but async_added_to_hass was called",
-                self.unique_id,
-            )
-            return
+            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)