Transition.

        :param duration: Time to transition.
        :param brightness: Transition to this brightness.
        :param hue: Transition to this hue.
        :param saturation: Transition to this saturation.
        :param temperature: Transition to this temperature.

def _transition(self, duration, brightness,
                    hue=None, saturation=None, temperature=None):
        """ Transition.

        :param duration: Time to transition.
        :param brightness: Transition to this brightness.
        :param hue: Transition to this hue.
        :param saturation: Transition to this saturation.
        :param temperature: Transition to this temperature.
        """
        # Calculate brightness steps.
        b_steps = 0
        if brightness is not None:
            b_steps = steps(self.brightness,
                            brightness, self.command_set.brightness_steps)
            b_start = self.brightness
        # Calculate hue steps.
        h_steps = 0
        if hue is not None:
            h_steps = steps(self.hue,
                            hue, self.command_set.hue_steps)
            h_start = self.hue
        # Calculate saturation steps.
        s_steps = 0
        if saturation is not None:
            s_steps = steps(self.saturation,
                            saturation, self.command_set.saturation_steps)
            s_start = self.saturation
        # Calculate temperature steps.
        t_steps = 0
        if temperature is not None:
            t_steps = steps(self.temperature,
                            temperature, self.command_set.temperature_steps)
            t_start = self.temperature
        # Compute ideal step amount (at least one).
        total_steps = max(b_steps, h_steps, s_steps, t_steps, 1)
        total_commands = b_steps + h_steps + s_steps + t_steps
        # Calculate wait.
        wait = self._wait(duration, total_steps, total_commands)
        # Scale down steps if no wait time.
        if wait == 0:
            scaled_steps = self._scale_steps(duration, total_commands, b_steps,
                                             h_steps, s_steps, t_steps)
            b_steps, h_steps, s_steps, t_steps = scaled_steps
            total_steps = max(b_steps, h_steps, s_steps, t_steps, 1)
        # Perform transition.
        for i in range(total_steps):
            # Brightness.
            if b_steps > 0 and i % math.ceil(total_steps/b_steps) == 0:
                self.brightness = util.transition(i, total_steps,
                                                  b_start, brightness)
            # Hue.
            if h_steps > 0 and i % math.ceil(total_steps/h_steps) == 0:
                self.hue = util.transition(i, total_steps,
                                           h_start, hue)
            # Saturation.
            if s_steps > 0 and i % math.ceil(total_steps/s_steps) == 0:
                self.saturation = util.transition(i, total_steps,
                                                  s_start, saturation)
            # Temperature.
            if t_steps > 0 and i % math.ceil(total_steps/t_steps) == 0:
                self.temperature = util.transition(i, total_steps,
                                                   t_start, temperature)

            # Wait.
            time.sleep(wait)