From 47f1d377f5da9a4be79b65512817d87aecc81558 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 21 Feb 2017 10:48:42 -0500 Subject: heater: Enforce min/max_temp in heater.set_temp() Raise an error if the user requests a temperate outside the configured min/max_temp range. Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'klippy/gcode.py') diff --git a/klippy/gcode.py b/klippy/gcode.py index d3932322..ce3c3ffe 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -191,7 +191,11 @@ class GCodeParser: def set_temp(self, heater, params, wait=False): print_time = self.toolhead.get_last_move_time() temp = float(params.get('S', '0')) - heater.set_temp(print_time, temp) + try: + heater.set_temp(print_time, temp) + except heater.error, e: + self.respond_error(str(e)) + return if wait: self.bg_temp(heater) # Individual command handlers -- cgit v1.2.3-70-g09d2