Group component now supports lists in the config

This commit is contained in:
Paulus Schoutsen 2015-02-28 19:22:16 -08:00
parent 004d4ed123
commit 80ffe74af6
2 changed files with 12 additions and 3 deletions

View File

@ -56,8 +56,13 @@ device_sun_light_trigger:
# A comma seperated list of states that have to be tracked as a single group
# Grouped states should share the same type of states (ON/OFF or HOME/NOT_HOME)
group:
living_room: light.Bowl,light.Ceiling,light.TV_back_light
children: device_tracker.child_1,device_tracker.child_2
living_room:
- light.Bowl
- light.Ceiling
- light.TV_back_light
children:
- device_tracker.child_1
- device_tracker.child_2
process:
# items are which processes to look for: <entity_id>: <search string within ps>

View File

@ -101,7 +101,11 @@ def get_entity_ids(hass, entity_id, domain_filter=None):
def setup(hass, config):
""" Sets up all groups found definded in the configuration. """
for name, entity_ids in config.get(DOMAIN, {}).items():
setup_group(hass, name, entity_ids.split(","))
# Support old deprecated method - 2/28/2015
if isinstance(entity_ids, str):
entity_ids = entity_ids.split(",")
setup_group(hass, name, entity_ids)
return True