mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
parent
445b0f6f94
commit
9381f187a4
@ -434,7 +434,10 @@ class YeelightLight(Light):
|
||||
def turn_off(self, **kwargs) -> None:
|
||||
"""Turn off."""
|
||||
import yeelight
|
||||
duration = int(self.config[CONF_TRANSITION]) # in ms
|
||||
if ATTR_TRANSITION in kwargs: # passed kwarg overrides config
|
||||
duration = int(kwargs.get(ATTR_TRANSITION) * 1000) # kwarg in s
|
||||
try:
|
||||
self._bulb.turn_off()
|
||||
self._bulb.turn_off(duration=duration)
|
||||
except yeelight.BulbException as ex:
|
||||
_LOGGER.error("Unable to turn the bulb off: %s", ex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user