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]
This commit is contained in:
Clayton Nummer 2019-07-30 18:25:02 -04:00
commit 14f272e8cd

View file

@ -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