Migrate remaining get_platform in check_config to async_get_platform (#112470)

These were very likely to be cached so they were low on the
list to migrate, but since they are called in the event loop
its best to be sure we do no blocking I/O
This commit is contained in:
J. Nick Koston
2024-03-05 18:47:41 -10:00
committed by GitHub
parent 0f69a0647c
commit 8fe80a4766
2 changed files with 4 additions and 4 deletions

View File

@@ -338,7 +338,7 @@ async def test_config_platform_import_error(hass: HomeAssistant) -> None:
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:\n platform: beer"}
with patch(
"homeassistant.loader.Integration.get_platform",
"homeassistant.loader.Integration.async_get_platform",
side_effect=ImportError("blablabla"),
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
res = await async_check_ha_config_file(hass)
@@ -358,7 +358,7 @@ async def test_platform_import_error(hass: HomeAssistant) -> None:
# Make sure they don't exist
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:\n platform: demo"}
with patch(
"homeassistant.loader.Integration.get_platform",
"homeassistant.loader.Integration.async_get_platform",
side_effect=[None, ImportError("blablabla")],
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
res = await async_check_ha_config_file(hass)