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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-02-21 10:48:42 -05:00
parent 566699f68a
commit 47f1d377f5
2 changed files with 16 additions and 3 deletions

View file

@ -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