mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Refactor: code moved to new helper and constants file. Also adds support for multiple types for switch/light components.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user