From 26974c8fd5db90f800592912080eca4b816f5710 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 3 Apr 2023 11:32:38 -0700 Subject: [PATCH] Simplify if-statement, (small #460 fix) (#526) --- custom_components/adaptive_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 4b9e1856..031396fe 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1067,7 +1067,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): return # See #80. Doesn't check if transitions differ but it does the job. last_service_data = self.turn_on_off_listener.last_service_data - if light in last_service_data and last_service_data[light] == service_data: + if last_service_data.get(light) == service_data: _LOGGER.debug( "%s: Cancelling adapt to light %s, there's no new values to set (context.id='%s')", self._name,