4
0
Эх сурвалжийг харах

Don't import device_config helper until needed.

Although the unit tests are able to run by limiting the import of device in __init__ until needed, the actual use in HA is still blocked.  Try to break this deadlock.
Jason Rumney 4 жил өмнө
parent
commit
cbc6e6b0de

+ 2 - 1
custom_components/tuya_local/device.py

@@ -16,7 +16,6 @@ from .const import (
     API_PROTOCOL_VERSIONS,
     API_PROTOCOL_VERSIONS,
     DOMAIN,
     DOMAIN,
 )
 )
-from .helpers.device_config import possible_matches
 
 
 _LOGGER = logging.getLogger(__name__)
 _LOGGER = logging.getLogger(__name__)
 
 
@@ -79,6 +78,8 @@ class TuyaLocalDevice(object):
 
 
     async def async_inferred_type(self):
     async def async_inferred_type(self):
 
 
+        from .helpers.device_config import possible_matches
+
         cached_state = self._get_cached_state()
         cached_state = self._get_cached_state()
         if "1" not in cached_state and "3" not in cached_state:
         if "1" not in cached_state and "3" not in cached_state:
             await self.async_refresh()
             await self.async_refresh()