Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions homeassistant/components/device_sun_light_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

CONF_LIGHT_PROFILE = 'light_profile'
CONF_LIGHT_GROUP = 'light_group'
CONF_DEVICE_GROUP = 'device_group'


# pylint: disable=too-many-branches
Expand All @@ -30,13 +31,18 @@ def setup(hass, config):
disable_turn_off = 'disable_turn_off' in config[DOMAIN]

light_group = config[DOMAIN].get(CONF_LIGHT_GROUP,
light.GROUP_NAME_ALL_LIGHTS)
'group.' + light.GROUP_NAME_ALL_LIGHTS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oeh nasty, that was wrong indeed. Instead of 'group.' + we should use light.ENTITY_ID_ALL_LIGHTS


light_profile = config[DOMAIN].get(CONF_LIGHT_PROFILE, LIGHT_PROFILE)

device_group = config[DOMAIN].get(CONF_DEVICE_GROUP,
'group.' +
device_tracker.GROUP_NAME_ALL_DEVICES)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use device_tracker.ENTITY_ID_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")
Expand Down