aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/filament_switch_sensor.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-04-24 23:41:42 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-05-05 11:08:12 -0400
commit1e992f9d1663b9bed314e2b44ffec913a432278b (patch)
tree84ce59c3a7ed28ba801850d7418cb73cc0dbb373 /klippy/extras/filament_switch_sensor.py
parent02ee379f82445016fd1b18b79b492f9a0f13725e (diff)
downloadkutter-1e992f9d1663b9bed314e2b44ffec913a432278b.tar.gz
kutter-1e992f9d1663b9bed314e2b44ffec913a432278b.tar.xz
kutter-1e992f9d1663b9bed314e2b44ffec913a432278b.zip
filament_switch_sensor: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/filament_switch_sensor.py')
-rw-r--r--klippy/extras/filament_switch_sensor.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/klippy/extras/filament_switch_sensor.py b/klippy/extras/filament_switch_sensor.py
index e25cbdf6..58d2bb07 100644
--- a/klippy/extras/filament_switch_sensor.py
+++ b/klippy/extras/filament_switch_sensor.py
@@ -91,15 +91,15 @@ class RunoutHelper:
def get_status(self, eventtime):
return {"filament_detected": bool(self.filament_present)}
cmd_QUERY_FILAMENT_SENSOR_help = "Query the status of the Filament Sensor"
- def cmd_QUERY_FILAMENT_SENSOR(self, params):
+ def cmd_QUERY_FILAMENT_SENSOR(self, gcmd):
if self.filament_present:
msg = "Filament Sensor %s: filament detected" % (self.name)
else:
msg = "Filament Sensor %s: filament not detected" % (self.name)
- self.gcode.respond_info(msg)
+ gcmd.respond_info(msg)
cmd_SET_FILAMENT_SENSOR_help = "Sets the filament sensor on/off"
- def cmd_SET_FILAMENT_SENSOR(self, params):
- self.sensor_enabled = self.gcode.get_int("ENABLE", params, 1)
+ def cmd_SET_FILAMENT_SENSOR(self, gcmd):
+ self.sensor_enabled = gcmd.get_int("ENABLE", 1)
class SwitchSensor:
def __init__(self, config):