def turn_on(self, **kwargs) -> None:
    'Turn the bulb on.'
    import yeelight
    brightness = kwargs.get(ATTR_BRIGHTNESS)
    colortemp = kwargs.get(ATTR_COLOR_TEMP)
    hs_color = kwargs.get(ATTR_HS_COLOR)
    rgb = (color_util.color_hs_to_RGB(*hs_color) if hs_color else None)
    flash = kwargs.get(ATTR_FLASH)
    effect = kwargs.get(ATTR_EFFECT)
    duration = int(self.config[CONF_TRANSITION])
    if (ATTR_TRANSITION in kwargs):
        duration = int((kwargs.get(ATTR_TRANSITION) * 1000))
    try:
        self._bulb.turn_on(duration=duration)
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to turn the bulb on: %s', ex)
        return
    if (self.config[CONF_MODE_MUSIC] and (not self._bulb.music_mode)):
        try:
            self.set_music_mode(self.config[CONF_MODE_MUSIC])
        except yeelight.BulbException as ex:
            _LOGGER.error('Unable to turn on music mode,consider disabling it: %s', ex)
    try:
        self.set_rgb(rgb, duration)
        self.set_colortemp(colortemp, duration)
        self.set_brightness(brightness, duration)
        self.set_flash(flash)
        self.set_effect(effect)
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to set bulb properties: %s', ex)
        return
    if (self.config[CONF_SAVE_ON_CHANGE] and (brightness or colortemp or rgb)):
        try:
            self.set_default()
        except yeelight.BulbException as ex:
            _LOGGER.error('Unable to set the defaults: %s', ex)
            return
Turn the bulb on.
def turn_on(self, **kwargs) -> None:
    
    import yeelight
    brightness = kwargs.get(ATTR_BRIGHTNESS)
    colortemp = kwargs.get(ATTR_COLOR_TEMP)
    hs_color = kwargs.get(ATTR_HS_COLOR)
    rgb = (color_util.color_hs_to_RGB(*hs_color) if hs_color else None)
    flash = kwargs.get(ATTR_FLASH)
    effect = kwargs.get(ATTR_EFFECT)
    duration = int(self.config[CONF_TRANSITION])
    if (ATTR_TRANSITION in kwargs):
        duration = int((kwargs.get(ATTR_TRANSITION) * 1000))
    try:
        self._bulb.turn_on(duration=duration)
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to turn the bulb on: %s', ex)
        return
    if (self.config[CONF_MODE_MUSIC] and (not self._bulb.music_mode)):
        try:
            self.set_music_mode(self.config[CONF_MODE_MUSIC])
        except yeelight.BulbException as ex:
            _LOGGER.error('Unable to turn on music mode,consider disabling it: %s', ex)
    try:
        self.set_rgb(rgb, duration)
        self.set_colortemp(colortemp, duration)
        self.set_brightness(brightness, duration)
        self.set_flash(flash)
        self.set_effect(effect)
    except yeelight.BulbException as ex:
        _LOGGER.error('Unable to set bulb properties: %s', ex)
        return
    if (self.config[CONF_SAVE_ON_CHANGE] and (brightness or colortemp or rgb)):
        try:
            self.set_default()
        except yeelight.BulbException as ex:
            _LOGGER.error('Unable to set the defaults: %s', ex)
            return