Migrate remaining call in check_config helper to use async_get_component (#113123)

This commit is contained in:
J. Nick Koston 2024-03-11 15:56:24 -10:00 committed by GitHub
parent 1949b9936b
commit 3f72fae60b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -192,7 +192,7 @@ async def async_check_ha_config_file( # noqa: C901
continue
try:
component = integration.get_component()
component = await integration.async_get_component()
except ImportError as ex:
result.add_warning(f"Component error: {domain} - {ex}")
continue

View file

@ -171,7 +171,7 @@ async def test_integration_import_error(hass: HomeAssistant) -> None:
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:"}
with patch(
"homeassistant.loader.Integration.get_component",
"homeassistant.loader.Integration.async_get_component",
side_effect=ImportError("blablabla"),
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
res = await async_check_ha_config_file(hass)