Switch config to use async_get_component/async_get_platform (#112071)

This commit is contained in:
J. Nick Koston 2024-03-02 13:56:25 -10:00 committed by GitHub
parent 08897137ff
commit 3808e8b0bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 21 deletions

View file

@ -1418,7 +1418,7 @@ async def async_process_component_config( # noqa: C901
config_exceptions: list[ConfigExceptionInfo] = []
try:
component = integration.get_component()
component = await integration.async_get_component()
except LOAD_EXCEPTIONS as exc:
exc_info = ConfigExceptionInfo(
exc,
@ -1433,7 +1433,7 @@ async def async_process_component_config( # noqa: C901
# Check if the integration has a custom config validator
config_validator = None
try:
config_validator = integration.get_platform("config")
config_validator = await integration.async_get_platform("config")
except ImportError as err:
# Filter out import error of the config platform.
# If the config platform contains bad imports, make sure
@ -1557,7 +1557,7 @@ async def async_process_component_config( # noqa: C901
continue
try:
platform = p_integration.get_platform(domain)
platform = await p_integration.async_get_platform(domain)
except LOAD_EXCEPTIONS as exc:
exc_info = ConfigExceptionInfo(
exc,