heaters: Make sure set_temp() command wakes up the idle_timeout

Introduce a heaters.set_temperature() command and call that from
commands that set a heater temperature.  This new function calls
toolhead.register_lookahead_callback() so that the idle_timeout gets
notification that activity has occurred.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2021-03-05 18:41:21 -05:00
parent 1950380d6c
commit 64b3e5642e
4 changed files with 14 additions and 12 deletions

View File

@@ -18,10 +18,8 @@ class PrinterHeaterBed:
def cmd_M140(self, gcmd, wait=False):
# Set Bed Temperature
temp = gcmd.get_float('S', 0.)
self.heater.set_temp(temp)
if wait and temp:
pheaters = self.printer.lookup_object('heaters')
pheaters.wait_for_temperature(self.heater)
pheaters = self.printer.lookup_object('heaters')
pheaters.set_temperature(self.heater, temp, wait)
def cmd_M190(self, gcmd):
# Set Bed Temperature and Wait
self.cmd_M140(gcmd, wait=True)