Skip to content

Commit

Permalink
Merge pull request #324 from basnijholt/service_data_empty
Browse files Browse the repository at this point in the history
Take care of edge case where no area_id or entity_id in service_data
  • Loading branch information
basnijholt authored Aug 30, 2022
2 parents dfee0fa + 52220b0 commit f049c8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/adaptive_lighting/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"config_flow": true,
"dependencies": [],
"codeowners": ["@basnijholt", "@RubenKelevra"],
"version": "1.0.17",
"version": "1.0.18",
"requirements": [],
"iot_class": "calculated"
}
5 changes: 5 additions & 0 deletions custom_components/adaptive_lighting/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,11 @@ async def turn_on_off_event_listener(self, event: Event) -> None:
_LOGGER.debug(
"Found entity_ids '%s' for area_id '%s'", entity_ids, area_id
)
else:
_LOGGER.debug(
"No entity_ids or area_ids found in service_data: %s", service_data
)
return

if not any(eid in self.lights for eid in entity_ids):
return
Expand Down

0 comments on commit f049c8d

Please sign in to comment.