From 9e22e70d63ad30347611c906de52c04ea776efea Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 30 Aug 2022 09:45:05 -0700 Subject: [PATCH] Take care of edge case where no area_id or entity_id in service_data --- custom_components/adaptive_lighting/switch.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 00555ef0..5eb29a9a 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1291,6 +1291,11 @@ class TurnOnOffListener: _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