From 80ffe74af6f9b3843eba10f09d28907598de6fe1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 28 Feb 2015 19:22:16 -0800 Subject: [PATCH] Group component now supports lists in the config --- config/configuration.yaml.example | 9 +++++++-- homeassistant/components/group.py | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config/configuration.yaml.example b/config/configuration.yaml.example index 1971cb26d70..355a24e94d4 100644 --- a/config/configuration.yaml.example +++ b/config/configuration.yaml.example @@ -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: : diff --git a/homeassistant/components/group.py b/homeassistant/components/group.py index a99654a19ed..4c5e6adb2c6 100644 --- a/homeassistant/components/group.py +++ b/homeassistant/components/group.py @@ -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