Refactor: code moved to new helper and constants file. Also adds support for multiple types for switch/light components.

This commit is contained in:
Paulus Schoutsen
2014-12-06 23:57:02 -08:00
parent 513a03fb46
commit 0527760e9b
41 changed files with 603 additions and 442 deletions

View File

@@ -37,8 +37,9 @@ def from_config_dict(config, hass=None):
# Convert it to defaultdict so components can always have config dict
config = defaultdict(dict, config)
# Filter out the common config section [homeassistant]
components = (key for key in config.keys() if key != homeassistant.DOMAIN)
# Filter out the repeating and common config section [homeassistant]
components = (key for key in config.keys()
if ' ' not in key and key != homeassistant.DOMAIN)
# Setup the components
if core_components.setup(hass, config):