mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
commit
2ba3df2257
@ -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…
x
Reference in New Issue
Block a user