From a5ebe5825aa6bbb58b3c755fab77b3472cceed8a Mon Sep 17 00:00:00 2001 From: Justin Schuh Date: Thu, 24 Dec 2020 08:34:26 -0800 Subject: heaters: Make MINIMUM optional for TEMPERATURE_WAIT command (#3674) Signed-off-by: Justin Schuh --- klippy/extras/heaters.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'klippy/extras/heaters.py') diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index 8a145f42..829e9759 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -329,8 +329,11 @@ class PrinterHeaters: sensor_name = gcmd.get('SENSOR') if sensor_name not in self.available_sensors: raise gcmd.error("Unknown sensor '%s'" % (sensor_name,)) - min_temp = gcmd.get_float('MINIMUM') + min_temp = gcmd.get_float('MINIMUM', float('-inf')) max_temp = gcmd.get_float('MAXIMUM', float('inf'), above=min_temp) + if min_temp == float('-inf') and max_temp == float('inf'): + raise gcmd.error( + "Error on 'TEMPERATURE_WAIT': missing MINIMUM or MAXIMUM.") if self.printer.get_start_args().get('debugoutput') is not None: return if sensor_name in self.heaters: -- cgit v1.2.3-70-g09d2