diff --git a/function/modules.py b/function/modules.py index a7176cc..c734ac1 100644 --- a/function/modules.py +++ b/function/modules.py @@ -313,4 +313,5 @@ class motion_sensor_light(common_base): def cyclic_task(self, cyclic_task): min_value = 10 if self.motion_detected() else 0 - self.set(self.KEY_TIMER, max(min_value, self[self.KEY_TIMER] - cyclic_task.cycle_time)) + if self[self.KEY_TIMER] != 0: + self.set(self.KEY_TIMER, max(min_value, self[self.KEY_TIMER] - cyclic_task.cycle_time))