mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Allow missing components in safe mode (#102888)
This commit is contained in:
parent
43915fbaf3
commit
294f565bad
@ -127,7 +127,7 @@ async def async_check_ha_config_file( # noqa: C901
|
|||||||
try:
|
try:
|
||||||
integration = await async_get_integration_with_requirements(hass, domain)
|
integration = await async_get_integration_with_requirements(hass, domain)
|
||||||
except loader.IntegrationNotFound as ex:
|
except loader.IntegrationNotFound as ex:
|
||||||
if not hass.config.recovery_mode:
|
if not hass.config.recovery_mode and not hass.config.safe_mode:
|
||||||
result.add_error(f"Integration error: {domain} - {ex}")
|
result.add_error(f"Integration error: {domain} - {ex}")
|
||||||
continue
|
continue
|
||||||
except RequirementsNotFound as ex:
|
except RequirementsNotFound as ex:
|
||||||
|
@ -125,6 +125,19 @@ async def test_component_not_found_recovery_mode(hass: HomeAssistant) -> None:
|
|||||||
assert not res.errors
|
assert not res.errors
|
||||||
|
|
||||||
|
|
||||||
|
async def test_component_not_found_safe_mode(hass: HomeAssistant) -> None:
|
||||||
|
"""Test no errors if component not found in safe mode."""
|
||||||
|
# Make sure they don't exist
|
||||||
|
files = {YAML_CONFIG_FILE: BASE_CONFIG + "beer:"}
|
||||||
|
hass.config.safe_mode = True
|
||||||
|
with patch("os.path.isfile", return_value=True), patch_yaml_files(files):
|
||||||
|
res = await async_check_ha_config_file(hass)
|
||||||
|
log_ha_config(res)
|
||||||
|
|
||||||
|
assert res.keys() == {"homeassistant"}
|
||||||
|
assert not res.errors
|
||||||
|
|
||||||
|
|
||||||
async def test_component_platform_not_found_2(hass: HomeAssistant) -> None:
|
async def test_component_platform_not_found_2(hass: HomeAssistant) -> None:
|
||||||
"""Test errors if component or platform not found."""
|
"""Test errors if component or platform not found."""
|
||||||
# Make sure they don't exist
|
# Make sure they don't exist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user