Add check_config API (#5898)
* Add check_config API * Add config panel to default config * Add tests * Lint * lint
This commit is contained in:
1 parent
dc6a28a8b2
commit
dab6d011ca
7 files changed
+107
-28
No files matched your search
@@ -156,10 +156,18 @@ def async_setup(hass, config):
|
||||
return
|
||||
|
||||
try:
|
||||
yield from conf_util.async_check_ha_config_file(hass)
|
||||
errors = yield from conf_util.async_check_ha_config_file(hass)
|
||||
except HomeAssistantError:
|
||||
return
|
||||
|
||||
if errors:
|
||||
notif = get_component('persistent_notification')
|
||||
_LOGGER.error(errors)
|
||||
notif.async_create(
|
||||
hass, "Config error. See dev-info panel for details.",
|
||||
"Config validating", "{0}.check_config".format(ha.DOMAIN))
|
||||
return
|
||||
|
||||
if call.service == SERVICE_HOMEASSISTANT_RESTART:
|
||||
hass.async_add_job(hass.async_stop(RESTART_EXIT_CODE))
|
||||
|
||||
|
||||
Reference in new issue
Block a user