From 98efae7e4040bb8798ca1b59da44be6885524bf7 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 1 Sep 2020 00:23:49 +0200 Subject: [PATCH] be explicit in unpacking RGB --- custom_components/circadian_lighting/switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 9e4e99f7..8519fe9f 100755 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -328,7 +328,8 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): if light_type == "ct": service_data[ATTR_COLOR_TEMP] = int(self.calc_ct()) elif light_type == "rgb": - service_data[ATTR_RGB_COLOR] = tuple(map(int, self.calc_rgb())) + r, g, b = self.calc_rgb() + service_data[ATTR_RGB_COLOR] = (int(r), int(g), int(b)) elif light_type == "xy": service_data[ATTR_XY_COLOR] = self.calc_xy() if service_data.get(ATTR_BRIGHTNESS, False):