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

device: enumerate matching configs in an executor.

As this involves filesystem interaction, HA now complains about this.

Issue #2133
Jason Rumney 1 год назад
Родитель
Сommit
3fa9e041f3
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      custom_components/tuya_local/device.py

+ 5 - 1
custom_components/tuya_local/device.py

@@ -357,7 +357,11 @@ class TuyaLocalDevice(object):
             await self.async_refresh()
             cached_state = self._get_cached_state()
 
-        for match in possible_matches(cached_state):
+        possible = await self._hass.async_add_executor_job(
+            possible_matches,
+            cached_state,
+        )
+        for match in possible:
             yield match
 
     async def async_inferred_type(self):