docs: def transition(self, duration, brightness=None):
          """ Transition wrapper.
  
          Short-circuit transition if necessary.
  
          :param duration: Duration of transition.
          :param brightness: Transition to this brightness.
          """
          if duration == 0:
              if brightness is not None:
                  self.brightness = brightness
              return
          if brightness != self.brightness:
              self._transition(duration, brightness)