Empty configuration.yaml no longer crashes setup

This commit is contained in:
Paulus Schoutsen 2015-03-16 21:58:37 -07:00
parent b0a09f01cc
commit a2558972b9

View File

@ -119,6 +119,11 @@ def from_config_file(config_path, hass=None):
if os.path.splitext(config_path)[1] == '.yaml': if os.path.splitext(config_path)[1] == '.yaml':
# Read yaml # Read yaml
config_dict = yaml.load(io.open(config_path, 'r')) config_dict = yaml.load(io.open(config_path, 'r'))
# If YAML file was empty
if config_dict is None:
config_dict = {}
else: else:
# Read config # Read config
config = configparser.ConfigParser() config = configparser.ConfigParser()