Skip to content

Commit

Permalink
Merge branch 'nicodreher-master' from PR #209
Browse files Browse the repository at this point in the history
* nicodreher-master:
  Fix calculating brightness percentage of 0% causing bad request
  • Loading branch information
tschamm committed Jan 11, 2025
2 parents 7be3f4d + 12ea362 commit d55f069
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/bosch_shc/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def turn_on(self, **kwargs):
brightness = kwargs.get(ATTR_BRIGHTNESS)

if brightness is not None and self._device.supports_brightness:
self._device.brightness = round(brightness * 100 / 255)
self._device.brightness = max(round(brightness * 100 / 255), 1)

if color_temp_kelvin is not None and self._device.supports_color_temp:
self._device.color = color_util.color_temperature_kelvin_to_mired(
Expand Down

0 comments on commit d55f069

Please sign in to comment.