heater_bed: Use new GCodeCommand wrappers

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-04-24 23:18:04 -04:00
parent 95919d1256
commit b24465976e
1 changed files with 4 additions and 5 deletions

View File

@ -15,17 +15,16 @@ class PrinterHeaterBed:
gcode = self.printer.lookup_object('gcode')
gcode.register_command("M140", self.cmd_M140)
gcode.register_command("M190", self.cmd_M190)
def cmd_M140(self, params, wait=False):
def cmd_M140(self, gcmd, wait=False):
# Set Bed Temperature
gcode = self.printer.lookup_object('gcode')
temp = gcode.get_float('S', params, 0.)
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)
def cmd_M190(self, params):
def cmd_M190(self, gcmd):
# Set Bed Temperature and Wait
self.cmd_M140(params, wait=True)
self.cmd_M140(gcmd, wait=True)
def load_config(config):
return PrinterHeaterBed(config)