commit
2ba3df2257
1 changed files with 3 additions and 2 deletions
|
@ -155,13 +155,14 @@ class RfxtrxLight(Light):
|
|||
def turn_on(self, **kwargs):
|
||||
""" Turn the light on. """
|
||||
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
||||
if not self._event:
|
||||
return
|
||||
|
||||
if brightness is None:
|
||||
self._brightness = 100
|
||||
self._event.device.send_on(rfxtrx.RFXOBJECT.transport)
|
||||
else:
|
||||
self._brightness = ((brightness + 4) * 100 // 255 - 1)
|
||||
|
||||
if hasattr(self, '_event') and self._event:
|
||||
self._event.device.send_dim(rfxtrx.RFXOBJECT.transport,
|
||||
self._brightness)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue