mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Empty configuration.yaml no longer crashes setup
This commit is contained in:
parent
b0a09f01cc
commit
a2558972b9
@ -119,6 +119,11 @@ def from_config_file(config_path, hass=None):
|
||||
if os.path.splitext(config_path)[1] == '.yaml':
|
||||
# Read yaml
|
||||
config_dict = yaml.load(io.open(config_path, 'r'))
|
||||
|
||||
# If YAML file was empty
|
||||
if config_dict is None:
|
||||
config_dict = {}
|
||||
|
||||
else:
|
||||
# Read config
|
||||
config = configparser.ConfigParser()
|
||||
|
Loading…
x
Reference in New Issue
Block a user