Allow missing components in safe mode (#102888)
parent
43915fbaf3
commit
294f565bad
|
@ -127,7 +127,7 @@ async def async_check_ha_config_file( # noqa: C901
|
|||
try:
|
||||
integration = await async_get_integration_with_requirements(hass, domain)
|
||||
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}")
|
||||
continue
|
||||
except RequirementsNotFound as ex:
|
||||
|
|
|
@ -125,6 +125,19 @@ async def test_component_not_found_recovery_mode(hass: HomeAssistant) -> None:
|
|||
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:
|
||||
"""Test errors if component or platform not found."""
|
||||
# Make sure they don't exist
|
||||
|
|
Loading…
Reference in New Issue