'Turn the device on.'

def turn_on(self, **kwargs):

    if (ATTR_TRANSITION in kwargs):
        transition = int((kwargs[ATTR_TRANSITION] * 10))
        _LOGGER.debug('turn_on    requested    transition    time    for    light:    %s    is:    %s', self._name, transition)
    else:
        transition = 0
        _LOGGER.debug('turn_on    requested    transition    time    for    light:    %s    is:    %s', self._name, transition)
    if (ATTR_BRIGHTNESS in kwargs):
        self._brightness = kwargs[ATTR_BRIGHTNESS]
        _LOGGER.debug('turn_on    requested    brightness    for    light:    %s    is:    %s    ', self._name, self._brightness)
        self._luminary.set_luminance(int((self._brightness / 2.55)), transition)
    else:
        self._luminary.set_onoff(1)
    if (ATTR_RGB_COLOR in kwargs):
        (red, green, blue) = kwargs[ATTR_RGB_COLOR]
        _LOGGER.debug('turn_on    requested    ATTR_RGB_COLOR    for    light:    %s    is:    %s    %s    %s    ', self._name, red, green, blue)
        self._luminary.set_rgb(red, green, blue, transition)
    if (ATTR_XY_COLOR in kwargs):
        (x_mired, y_mired) = kwargs[ATTR_XY_COLOR]
        _LOGGER.debug('turn_on    requested    ATTR_XY_COLOR    for    light:    %s    is:    %s,%s', self._name, x_mired, y_mired)
        (red, green, blue) = color_xy_brightness_to_RGB(x_mired, y_mired, self._brightness)
        self._luminary.set_rgb(red, green, blue, transition)
    if (ATTR_COLOR_TEMP in kwargs):
        color_t = kwargs[ATTR_COLOR_TEMP]
        kelvin = int(color_temperature_mired_to_kelvin(color_t))
        _LOGGER.debug('turn_on    requested    set_temperature    for    light:    %s:    %s', self._name, kelvin)
        self._luminary.set_temperature(kelvin, transition)
    if (ATTR_EFFECT in kwargs):
        effect = kwargs.get(ATTR_EFFECT)
        if (effect == EFFECT_RANDOM):
            self._luminary.set_rgb(random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255), transition)
            _LOGGER.debug('turn_on    requested    random    effect    for    light:    %s    with    transition    %s', self._name, transition)
    self.schedule_update_ha_state()
