From 3f72fae60b3364d9256b2bc00a3cf4be9a0bbd5a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 11 Mar 2024 15:56:24 -1000 Subject: [PATCH] Migrate remaining call in check_config helper to use async_get_component (#113123) --- homeassistant/helpers/check_config.py | 2 +- tests/helpers/test_check_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/check_config.py b/homeassistant/helpers/check_config.py index 2f716ac8bb1..86083b31b2f 100644 --- a/homeassistant/helpers/check_config.py +++ b/homeassistant/helpers/check_config.py @@ -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 diff --git a/tests/helpers/test_check_config.py b/tests/helpers/test_check_config.py index 09ecaac6638..bba9c3f27c4 100644 --- a/tests/helpers/test_check_config.py +++ b/tests/helpers/test_check_config.py @@ -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)