check_config script evolution (#12792)

* Initial async_check_ha_config_file

* check_ha_config_file

* Various fixes

* feedback - return the config

* move_to_check_config
This commit is contained in:
Johann Kellerman authored and Paulus Schoutsen committed 2018-03-09 09:31:13 -08:00
1 parent b2210f429e
commit 16d72d2351
5 files changed
+316 -254

No files matched your search

+3 -8
View File
@@ -112,18 +112,13 @@ def async_from_config_dict(config: Dict[str, Any],
if not loader.PREPARED:
yield from hass.async_add_job(loader.prepare, hass)
# Make a copy because we are mutating it.
config = OrderedDict(config)
# Merge packages
conf_util.merge_packages_config(
config, core_config.get(conf_util.CONF_PACKAGES, {}))
# Make a copy because we are mutating it.
# Use OrderedDict in case original one was one.
# Convert values to dictionaries if they are None
new_config = OrderedDict()
for key, value in config.items():
new_config[key] = value or {}
config = new_config
hass.config_entries = config_entries.ConfigEntries(hass, config)
yield from hass.config_entries.async_load()