code: def _transition(self, duration, brightness, temperature):
          
          # Set initial value.
          b_start = self.brightness
          t_start = self.temperature
          # Compute ideal step amount.
          b_steps = 0
          if brightness is not None:
              b_steps = steps(self.brightness, brightness,
                              self.command_set.brightness_steps)
          t_steps = 0
          if temperature is not None:
              t_steps = steps(self.temperature, temperature,
                              self.command_set.temperature_steps)
          # Compute ideal step amount (at least one).
          total_steps = max(b_steps, t_steps, 1)
          total_commands = b_steps + t_steps
          # Calculate wait.
          wait = self._wait(duration, total_steps, total_commands)
          # Scale down steps if no wait time.
          if wait == 0:
              b_steps, t_steps = self._scale_steps(duration, total_commands,
                                                   b_steps, t_steps)
              total_steps = max(b_steps, t_steps, 1)
          # Perform transition.
          for i in range(total_steps):
              # Brightness.
              if b_steps > 0 and i % (total_steps / b_steps) == 0:
                  self.brightness = util.transition(i, total_steps,
                                                    b_start, brightness)
              # Temperature.
              elif t_steps > 0:
                  self.temperature = util.transition(i, total_steps,
                                                     t_start, temperature)
              # Wait.
              time.sleep(wait)
docs: Complete a transition.
  
          :param duration: Duration of transition.
          :param brightness: Transition to this brightness.
          :param temperature: Transition to this temperature.