diff options
author | Justin Schuh <jschuh@users.noreply.github.com> | 2020-12-24 08:34:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-24 11:34:26 -0500 |
commit | a5ebe5825aa6bbb58b3c755fab77b3472cceed8a (patch) | |
tree | ce2e63d8e974207a9b6106f3f08c28fd27d18030 | |
parent | 1a9218532be81f6a3f8670aa5627aa305b7b43ff (diff) | |
download | kutter-a5ebe5825aa6bbb58b3c755fab77b3472cceed8a.tar.gz kutter-a5ebe5825aa6bbb58b3c755fab77b3472cceed8a.tar.xz kutter-a5ebe5825aa6bbb58b3c755fab77b3472cceed8a.zip |
heaters: Make MINIMUM optional for TEMPERATURE_WAIT command (#3674)
Signed-off-by: Justin Schuh <code@justinschuh.com>
-rw-r--r-- | docs/G-Codes.md | 6 | ||||
-rw-r--r-- | klippy/extras/heaters.py | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 06c1a7d0..c61a6031 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -156,9 +156,9 @@ The following standard commands are supported: /tmp/heattest.txt will be created with a log of all temperature samples taken during the test. - `TURN_OFF_HEATERS`: Turn off all heaters. -- `TEMPERATURE_WAIT SENSOR=<config_name> MINIMUM=<target> [MAXIMUM=<target>]`: - Wait until the given temperature sensor is at or above the given - minumum target, and (if specified) at or below the maximum target. +- `TEMPERATURE_WAIT SENSOR=<config_name> [MINIMUM=<target>] [MAXIMUM=<target>]`: + Wait until the given temperature sensor is at or above the supplied + MINIMUM and/or at or below the supplied MAXIMUM. - `SET_VELOCITY_LIMIT [VELOCITY=<value>] [ACCEL=<value>] [ACCEL_TO_DECEL=<value>] [SQUARE_CORNER_VELOCITY=<value>]`: Modify the printer's velocity limits. Note that one may only set values 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: |