From 14f272e8cd197ecfd347d85abe201d03d616b88b Mon Sep 17 00:00:00 2001 From: Clayton Nummer Date: Tue, 30 Jul 2019 18:25:02 -0400 Subject: [PATCH] Change brightness scale to max at 254 Supposedly the max light brightness is 255, but my Hue and Lightify lights both max at 254. 0 turns off the light, so the range is probably (0, 255) not [0, 255] --- custom_components/circadian_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 8264fc49..8186d346 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -267,7 +267,7 @@ class CircadianSwitch(SwitchDevice, RestoreEntity): if transition == None: transition = self._cl.data['transition'] - brightness = int((self._attributes['brightness'] / 100) * 255) if self._attributes['brightness'] is not None else None + brightness = int((self._attributes['brightness'] / 100) * 254) if self._attributes['brightness'] is not None else None mired = int(self.calc_ct()) if self._lights_ct is not None else None rgb = tuple(map(int, self.calc_rgb())) if self._lights_rgb is not None else None xy = self.calc_xy() if self._lights_xy is not None else None