diff --git a/mpf/platforms/interfaces/light_platform_interface.py b/mpf/platforms/interfaces/light_platform_interface.py index 58e8a690a..013207c43 100644 --- a/mpf/platforms/interfaces/light_platform_interface.py +++ b/mpf/platforms/interfaces/light_platform_interface.py @@ -90,12 +90,12 @@ class LightPlatformDirectFade(LightPlatformInterface, metaclass=abc.ABCMeta): if fade_ms > max_fade_ms: # we have to continue the fade later - if self.task: + if self.task and not self.task.done: self.task.cancel() self.task = self.loop.create_task(self._fade(start_brightness, start_time, target_brightness, target_time)) self.task.add_done_callback(Util.raise_exceptions) else: - if self.task: + if self.task and not self.task.done: self.task.cancel() self.task = None self.set_brightness_and_fade(target_brightness, max(fade_ms, 0))