1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 06:28:31 +00:00

Fix bug in check_config when an integration is removed by its own validator (#96068)

* Raise if present is False

* Fix feedback

* Update homeassistant/helpers/check_config.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/helpers/check_config.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix tests

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Joost Lekkerkerker
2023-07-20 11:45:44 +02:00
committed by GitHub
parent 4e2b00a443
commit 0ba2531ca4
2 changed files with 22 additions and 2 deletions

View File

@@ -181,7 +181,9 @@ async def async_check_ha_config_file( # noqa: C901
if config_schema is not None:
try:
config = config_schema(config)
result[domain] = config[domain]
# Don't fail if the validator removed the domain from the config
if domain in config:
result[domain] = config[domain]
except vol.Invalid as ex:
_comp_error(ex, domain, config)
continue