From fb16e8810b3e2da76c16e05834dc6be5776e3172 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 24 Apr 2020 22:20:29 -0400 Subject: [PATCH] idle_timeout: Use new GCodeCommand wrappers Signed-off-by: Kevin O'Connor --- klippy/extras/idle_timeout.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/klippy/extras/idle_timeout.py b/klippy/extras/idle_timeout.py index 260011a6..ff8ce6ee 100644 --- a/klippy/extras/idle_timeout.py +++ b/klippy/extras/idle_timeout.py @@ -98,16 +98,13 @@ class IdleTimeout: self.reactor.update_timer(self.timeout_timer, curtime + check_time) self.printer.send_event("idle_timeout:printing", est_print_time + PIN_MIN_TIME) - def cmd_SET_IDLE_TIMEOUT(self, params): - timeout = self.gcode.get_float( - 'TIMEOUT', params, self.idle_timeout, above=0.) + def cmd_SET_IDLE_TIMEOUT(self, gcmd): + timeout = gcmd.get_float('TIMEOUT', self.idle_timeout, above=0.) self.idle_timeout = timeout - self.gcode.respond_info( - "idle_timeout: Timeout set to %.2f s" % timeout) + gcmd.respond_info("idle_timeout: Timeout set to %.2f s" % (timeout,)) if self.state == "Ready": checktime = self.reactor.monotonic() + timeout - self.reactor.update_timer( - self.timeout_timer, checktime) + self.reactor.update_timer(self.timeout_timer, checktime) def load_config(config): return IdleTimeout(config)