code: def set(self, is_on=None, brightness=None, cancel_transition=True):
          
          if cancel_transition:
              self._cancel_active_transition()
  
          if is_on is not None:
              self._is_on = is_on
  
          if brightness is not None:
              self._assert_is_brightness(brightness)
              self._brightness = brightness
  
          self._update_pwm()
docs: Set properties of the led simultaneously before updating pwm values.
  
          :param is_on: On-off state of the led.
          :param brightness: Brightness of the led.
          :param cancel_transition: Cancel active transitions.