aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Schuh <jschuh@users.noreply.github.com>2020-12-22 19:09:28 -0800
committerKevinOConnor <kevin@koconnor.net>2020-12-23 18:16:46 -0500
commit1a9218532be81f6a3f8670aa5627aa305b7b43ff (patch)
tree0bf098d2f53450f01fd2124ec4cc754eab61bd22
parent16963a8e1af2babe0b0abc0ca044de8877e03617 (diff)
downloadkutter-1a9218532be81f6a3f8670aa5627aa305b7b43ff.tar.gz
kutter-1a9218532be81f6a3f8670aa5627aa305b7b43ff.tar.xz
kutter-1a9218532be81f6a3f8670aa5627aa305b7b43ff.zip
heaters: Add MAXIMUM option to TEMPERATURE_WAIT command
Signed-off-by: Justin Schuh <code@justinschuh.com>
-rw-r--r--docs/G-Codes.md5
-rw-r--r--klippy/extras/heaters.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/docs/G-Codes.md b/docs/G-Codes.md
index 951b01bf..06c1a7d0 100644
--- a/docs/G-Codes.md
+++ b/docs/G-Codes.md
@@ -156,8 +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>`: Wait until
- the given temperature sensor is at or above the given target value.
+- `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.
- `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 b9878e2a..8a145f42 100644
--- a/klippy/extras/heaters.py
+++ b/klippy/extras/heaters.py
@@ -330,6 +330,7 @@ class PrinterHeaters:
if sensor_name not in self.available_sensors:
raise gcmd.error("Unknown sensor '%s'" % (sensor_name,))
min_temp = gcmd.get_float('MINIMUM')
+ max_temp = gcmd.get_float('MAXIMUM', float('inf'), above=min_temp)
if self.printer.get_start_args().get('debugoutput') is not None:
return
if sensor_name in self.heaters:
@@ -341,7 +342,7 @@ class PrinterHeaters:
eventtime = reactor.monotonic()
while not self.printer.is_shutdown():
temp, target = sensor.get_temp(eventtime)
- if temp >= min_temp:
+ if temp >= min_temp and temp <= max_temp:
return
print_time = toolhead.get_last_move_time()
gcmd.respond_raw(self._get_temp(eventtime))