From 34c4fdb71a770d26bfcf0095bc1e847619414350 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 25 Aug 2020 18:30:08 +0200 Subject: [PATCH] don't run if statements that will never run --- custom_components/circadian_lighting/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 34c97121..6cf89b52 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -373,7 +373,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): ) # Set color of array of rgb. - if self._lights_rgb is not None and light in self._lights_rgb: + elif self._lights_rgb is not None and light in self._lights_rgb: service_data = {ATTR_ENTITY_ID: light} if rgb is not None: service_data[ATTR_RGB_COLOR] = rgb @@ -388,7 +388,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): ) # Set color of array of xy. - if self._lights_xy is not None and light in self._lights_xy: + elif self._lights_xy is not None and light in self._lights_xy: service_data = {ATTR_ENTITY_ID: light} if xy is not None: service_data[ATTR_XY_COLOR] = xy @@ -404,7 +404,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): ) # Set color of array of brightness. - if self._lights_brightness is not None and light in self._lights_brightness: + elif self._lights_brightness is not None and light in self._lights_brightness: service_data = {ATTR_ENTITY_ID: light} if brightness is not None: service_data[ATTR_BRIGHTNESS] = brightness