def turn_off(self, **kwargs) -> None:
    'Turn off.'
    import yeelight
    duration = int(self.config[CONF_TRANSITION])
    if (ATTR_TRANSITION in kwargs):
        duration = int((kwargs.get(ATTR_TRANSITION) * 1000))
    try:
        self._bulb.turn_off(duration=duration)
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to turn the bulb off: %s', ex)
Turn off.
def turn_off(self, **kwargs) -> None:
    
    import yeelight
    duration = int(self.config[CONF_TRANSITION])
    if (ATTR_TRANSITION in kwargs):
        duration = int((kwargs.get(ATTR_TRANSITION) * 1000))
    try:
        self._bulb.turn_off(duration=duration)
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to turn the bulb off: %s', ex)