mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 22:55:10 +02:00
enabled attribute transition in light service for homematic dimmer devices
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS, ATTR_EFFECT, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
|
ATTR_BRIGHTNESS, ATTR_EFFECT, ATTR_HS_COLOR, ATTR_TRANSITION, SUPPORT_BRIGHTNESS,
|
||||||
SUPPORT_COLOR, SUPPORT_EFFECT, Light)
|
SUPPORT_COLOR, SUPPORT_EFFECT, Light)
|
||||||
|
|
||||||
from . import ATTR_DISCOVER_DEVICES, HMDevice
|
from . import ATTR_DISCOVER_DEVICES, HMDevice
|
||||||
@@ -77,6 +77,9 @@ class HMLight(HMDevice, Light):
|
|||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
"""Turn the light on and/or change color or color effect settings."""
|
"""Turn the light on and/or change color or color effect settings."""
|
||||||
|
if ATTR_TRANSITION in kwargs:
|
||||||
|
self._hmdevice.setValue('RAMP_TIME', kwargs[ATTR_TRANSITION])
|
||||||
|
|
||||||
if ATTR_BRIGHTNESS in kwargs and self._state == "LEVEL":
|
if ATTR_BRIGHTNESS in kwargs and self._state == "LEVEL":
|
||||||
percent_bright = float(kwargs[ATTR_BRIGHTNESS]) / 255
|
percent_bright = float(kwargs[ATTR_BRIGHTNESS]) / 255
|
||||||
self._hmdevice.set_level(percent_bright, self._channel)
|
self._hmdevice.set_level(percent_bright, self._channel)
|
||||||
|
Reference in New Issue
Block a user