aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2019-09-07 08:33:44 -0400
committerKevinOConnor <kevin@koconnor.net>2019-09-08 20:42:43 -0400
commit49779f13a23be766b3a131a285f7fb5447488c74 (patch)
treefb23c2416a1494c0a7176f8b7b35048d9dc2a547 /klippy/extras
parenta78329d0b24aca97532b8d33355a5cc82d54575d (diff)
downloadkutter-49779f13a23be766b3a131a285f7fb5447488c74.tar.gz
kutter-49779f13a23be766b3a131a285f7fb5447488c74.tar.xz
kutter-49779f13a23be766b3a131a285f7fb5447488c74.zip
filament_switch_sensor: Add a delay between dispatch of pause and execution of pause gcode
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/filament_switch_sensor.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/klippy/extras/filament_switch_sensor.py b/klippy/extras/filament_switch_sensor.py
index a5b189df..257980a8 100644
--- a/klippy/extras/filament_switch_sensor.py
+++ b/klippy/extras/filament_switch_sensor.py
@@ -21,6 +21,7 @@ class BaseSensor(object):
if config.get('insert_gcode', None) is not None:
self.insert_gcode = gcode_macro.load_template(
config, 'insert_gcode')
+ self.pause_delay = config.getfloat('pause_delay', .5, above=.0)
self.runout_enabled = False
self.insert_enabled = self.insert_gcode is not None
self.event_running = False
@@ -52,6 +53,7 @@ class BaseSensor(object):
pause_resume = self.printer.lookup_object('pause_resume')
pause_resume.send_pause_command()
pause_prefix = "PAUSE\n"
+ self.printer.get_reactor().pause(eventtime + self.pause_delay)
self._exec_gcode(pause_prefix, self.runout_gcode)
self.event_running = False
def _insert_event_handler(self, eventtime):