From 129a2e8d6c4d65f10d8ed5f7434c2202626f6f59 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Sat, 4 Nov 2023 20:35:22 +0100 Subject: [PATCH] Update filament_switch_sensor.py --- klippy/extras/filament_switch_sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/klippy/extras/filament_switch_sensor.py b/klippy/extras/filament_switch_sensor.py index a59ff18ddf1b..20f78ffb72c6 100644 --- a/klippy/extras/filament_switch_sensor.py +++ b/klippy/extras/filament_switch_sensor.py @@ -37,7 +37,7 @@ def __init__(self, config, defined_sensor, runout_distance=0): self.filament_present = False self.sensor_enabled = True self.runout_position = 0. - self.runout_since = -1 + self.runout_elapsed = -1 self.runout_distance_timer = None self.force_trigger = False # Register commands and event handlers @@ -90,10 +90,10 @@ def _pause_after_distance(self, eventtime): ) if (runout_since < self.runout_distance): - self.runout_since = runout_since + self.runout_elapsed = runout_since return eventtime + CHECK_RUNOUT_TIMEOUT else: - self.runout_since = -1 + self.runout_elapsed = -1 self._execute_runout(eventtime) return self.reactor.NEVER def _insert_event_handler(self, eventtime): @@ -187,7 +187,7 @@ def sensor_get_status(self, eventtime): "filament_detected": bool(self.runout_helper.filament_present), "enabled": bool(self.runout_helper.sensor_enabled), "runout_distance": float(self.runout_helper.runout_distance), - "runout_since": float(self.runout_helper.runout_since)} + "runout_elapsed": float(self.runout_helper.runout_elapsed)} def set_filament_sensor(self, gcmd): enable = gcmd.get_int('ENABLE', None, minval=0, maxval=1) reset = gcmd.get_int('RESET', None, minval=0, maxval=1)