From f2077a483f1752ee3b71c4591d2800e6c1b1732e Mon Sep 17 00:00:00 2001 From: Zeanon Date: Sat, 14 Oct 2023 22:29:29 +0200 Subject: [PATCH] Update filament_switch_sensor.py --- klippy/extras/filament_switch_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klippy/extras/filament_switch_sensor.py b/klippy/extras/filament_switch_sensor.py index 37bcf98f3d2f..1e24fb114b87 100644 --- a/klippy/extras/filament_switch_sensor.py +++ b/klippy/extras/filament_switch_sensor.py @@ -60,12 +60,12 @@ def _runout_event_handler(self, eventtime): # of pause_resume execute immediately. if self.runout_distance > 0: if self.runout_distance_timer is None: - if self.immediate_runout_gcode is not None: - self._exec_gcode("", self.immediate_runout_gcode) self.runout_position = (self.defined_sensor .get_extruder_pos(eventtime)) self.runout_distance_timer = self.reactor.register_timer( self._pause_after_distance, self.reactor.NOW) + if self.immediate_runout_gcode is not None: + self._exec_gcode("", self.immediate_runout_gcode) else: self._execute_runout(eventtime) def _execute_runout(self, eventtime):