'Turn the device on.'

def turn_on(self, **kwargs):

    if (ATTR_TRANSITION in kwargs):
        fade = int((kwargs[ATTR_TRANSITION] * 1000))
    else:
        fade = 0
    if (ATTR_RGB_COLOR in kwargs):
        (hue, saturation, brightness) = convert_rgb_to_hsv(kwargs[ATTR_RGB_COLOR])
    else:
        hue = self._hue
        saturation = self._sat
        brightness = self._bri
    if (ATTR_BRIGHTNESS in kwargs):
        brightness = (kwargs[ATTR_BRIGHTNESS] * (BYTE_MAX + 1))
    else:
        brightness = self._bri
    if (ATTR_COLOR_TEMP in kwargs):
        kelvin = int(color_temperature_mired_to_kelvin(kwargs[ATTR_COLOR_TEMP]))
    else:
        kelvin = self._kel
    _LOGGER.debug('turn_on:    %s    (%d)    %d    %d    %d    %d    %d', self._ip, self._power, hue, saturation, brightness, kelvin, fade)
    if (self._power == 0):
        self._liffylights.set_color(self._ip, hue, saturation, brightness, kelvin, 0)
        self._liffylights.set_power(self._ip, 65535, fade)
    else:
        self._liffylights.set_color(self._ip, hue, saturation, brightness, kelvin, fade)
