def __init__(self, driver, duration, state_stages,<EOL>pwm_stages, callback=None):
self._driver = driver<EOL>self._callback = callback<EOL>self.duration = duration<EOL>self.state_stages = state_stages<EOL>self.pwm_stages = pwm_stages<EOL>self.stage_index = <NUM_LIT:0><EOL>self.cancelled = False<EOL>self.finished = False<EOL>self._finish_event = threading.Event()<EOL>self._start_time = time.time()<EOL>
Initialize the transition.

:param driver: The driver of the led.
:param duration: The duration.
:param state_stages: The state stages to be executed.
:param pwm_stages: The pwm stages to be executed.
:param callback: Callback that is called when transition has finished.