Skip to content

Commit

Permalink
Update filament_switch_sensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Nov 4, 2023
1 parent 903a8b2 commit 129a2e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions klippy/extras/filament_switch_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 129a2e8

Please sign in to comment.