Add support for importing integrations in the executor (#111336)

* Add support for pre-imports at setup time

alternative solution to #111331

* refactor

* refactor

* refactor

* mark >1.0s integrations

* no point in executor if already loaded

* no point in executor if already loaded

* cleanup

* cleanup

* two more

* one more

* analytics loads a lot more integrations

* cloud

* debug

* psutil, hardwre

* try zha

* Update homeassistant/setup.py

* await

* comments

* coverage

* coverage

* coverage

* move logic to loader

* move logic to loader

* preserve comments
This commit is contained in:
J. Nick Koston 2024-02-26 09:49:43 -10:00 committed by GitHub
parent 75e59167de
commit 4ea1c5cc3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 278 additions and 9 deletions

View file

@ -476,7 +476,7 @@ class ConfigEntry:
if domain_is_integration:
try:
integration.get_platform("config_flow")
await integration.async_get_platform("config_flow")
except ImportError as err:
_LOGGER.error(
(
@ -2427,9 +2427,8 @@ async def _load_integration(
# Make sure requirements and dependencies of component are resolved
await async_process_deps_reqs(hass, hass_config, integration)
try:
integration.get_platform("config_flow")
await integration.async_get_platform("config_flow")
except ImportError as err:
_LOGGER.error(
"Error occurred loading flow for integration %s: %s",