Skip to content

Commit

Permalink
Fix tradfri problem with brightness (#10359)
Browse files Browse the repository at this point in the history
* Fix problem with brightness

* Fix typo

* Typo
  • Loading branch information
Patrik authored and balloob committed Nov 5, 2017
1 parent aae9697 commit 73cd902
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions homeassistant/components/light/tradfri.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def async_turn_on(self, **kwargs):
keys['transition_time'] = int(kwargs[ATTR_TRANSITION]) * 10

if ATTR_BRIGHTNESS in kwargs:
if kwargs[ATTR_BRIGHTNESS] == 255:
kwargs[ATTR_BRIGHTNESS] = 254

self.hass.async_add_job(self._api(
self._group.set_dimmer(kwargs[ATTR_BRIGHTNESS], **keys)))
else:
Expand Down Expand Up @@ -264,6 +267,9 @@ def async_turn_on(self, **kwargs):
keys['transition_time'] = int(kwargs[ATTR_TRANSITION]) * 10

if ATTR_BRIGHTNESS in kwargs:
if kwargs[ATTR_BRIGHTNESS] == 255:
kwargs[ATTR_BRIGHTNESS] = 254

self.hass.async_add_job(self._api(
self._light_control.set_dimmer(kwargs[ATTR_BRIGHTNESS],
**keys)))
Expand Down

0 comments on commit 73cd902

Please sign in to comment.