'Instruct the switch to turn on & adjust brightness.'

def turn_on(self, **kwargs):

    attribs = {'power': 'ON'}
    if (ATTR_BRIGHTNESS in kwargs):
        min_level = self._switch.get('minLevel', 0)
        max_level = self._switch.get('maxLevel', 100)
        brightness = int(((kwargs[ATTR_BRIGHTNESS] * max_level) / 255))
        brightness = max(brightness, min_level)
        attribs['brightness'] = brightness
    if (ATTR_TRANSITION in kwargs):
        transition = int(kwargs[ATTR_TRANSITION])
        attribs['fadeOnTime'] = attribs['fadeOffTime'] = transition
    try:
        self._switch.update_attributes(attribs)
    except ValueError:
        _LOGGER.error('Failed    to    turn    on    myLeviton    switch.')
