From cec5ca8ba2dcb0a05a904681e7c84ec4bb6c0332 Mon Sep 17 00:00:00 2001 From: trainman419 Date: Mon, 15 Dec 2014 00:14:10 -0800 Subject: [PATCH] Specify devices for trigger --- homeassistant/components/device_sun_light_trigger.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/device_sun_light_trigger.py b/homeassistant/components/device_sun_light_trigger.py index 5136340832f..a8f8fd11519 100644 --- a/homeassistant/components/device_sun_light_trigger.py +++ b/homeassistant/components/device_sun_light_trigger.py @@ -21,6 +21,7 @@ LIGHT_PROFILE = 'relax' CONF_LIGHT_PROFILE = 'light_profile' CONF_LIGHT_GROUP = 'light_group' +CONF_DEVICE_GROUP = 'device_group' # pylint: disable=too-many-branches @@ -34,9 +35,13 @@ def setup(hass, config): light_profile = config[DOMAIN].get(CONF_LIGHT_PROFILE, LIGHT_PROFILE) + device_group = config[DOMAIN].get(CONF_LIGHT_GROUP, + device_tracker.GROUP_NAME_ALL_DEVICES) + logger = logging.getLogger(__name__) - device_entity_ids = hass.states.entity_ids(device_tracker.DOMAIN) + device_entity_ids = group.get_entity_ids(hass, device_group, + device_tracker.DOMAIN) if not device_entity_ids: logger.error("No devices found to track")