Don't allow hass.config.config_dir to be None (#98442)

This commit is contained in:
Erik Montnemery
2023-08-16 13:00:14 +02:00
committed by GitHub
parent 5ed3e90607
commit 91faa53843
18 changed files with 28 additions and 56 deletions

View File

@@ -337,7 +337,6 @@ async def async_create_default_config(hass: HomeAssistant) -> bool:
Return if creation was successful.
"""
assert hass.config.config_dir
return await hass.async_add_executor_job(
_write_default_config, hass.config.config_dir
)
@@ -390,10 +389,7 @@ async def async_hass_config_yaml(hass: HomeAssistant) -> dict:
This function allow a component inside the asyncio loop to reload its
configuration by itself. Include package merge.
"""
if hass.config.config_dir is None:
secrets = None
else:
secrets = Secrets(Path(hass.config.config_dir))
secrets = Secrets(Path(hass.config.config_dir))
# Not using async_add_executor_job because this is an internal method.
config = await hass.loop.run_in_executor(