Move elevation to core config and clean up HTTP mocking in tests (#2378)
* Stick version numbers * Move elevation to core config * Migrate forecast test to requests-mock * Migrate YR tests to requests-mock * Add requests_mock to requirements_test.txt * Move conf code from bootstrap to config * More config fixes * Fix some more issues * Add test for set config and failing auto detect
This commit is contained in:
1 parent
dc75b28b90
commit
6714392e9c
26 files changed
+1779
-337
No files matched your search
@@ -121,16 +121,16 @@ def setup(hass, config):
|
||||
def handle_reload_config(call):
|
||||
"""Service handler for reloading core config."""
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant import config, bootstrap
|
||||
from homeassistant import config as conf_util
|
||||
|
||||
try:
|
||||
path = config.find_config_file(hass.config.config_dir)
|
||||
conf = config.load_yaml_config_file(path)
|
||||
path = conf_util.find_config_file(hass.config.config_dir)
|
||||
conf = conf_util.load_yaml_config_file(path)
|
||||
except HomeAssistantError as err:
|
||||
_LOGGER.error(err)
|
||||
return
|
||||
|
||||
bootstrap.process_ha_core_config(hass, conf.get(ha.DOMAIN) or {})
|
||||
conf_util.process_ha_core_config(hass, conf.get(ha.DOMAIN) or {})
|
||||
|
||||
hass.services.register(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG,
|
||||
handle_reload_config)
|
||||
|
||||
Reference in new issue
Block a user