Commit c8921578 authored by D1plo1d's avatar D1plo1d

Fixing do_bedtemp so that it throws the correct errors.

parent 76cd27bc
...@@ -1121,21 +1121,21 @@ class pronsole(cmd.Cmd): ...@@ -1121,21 +1121,21 @@ class pronsole(cmd.Cmd):
return [i for i in self.temps.keys() if i.startswith(text)] return [i for i in self.temps.keys() if i.startswith(text)]
def do_bedtemp(self, l): def do_bedtemp(self, l):
try: try:
l = l.lower().replace(", ",".") l = l.lower().replace(", ",".")
for i in self.bedtemps.keys(): for i in self.bedtemps.keys():
l = l.replace(i, self.bedtemps[i]) l = l.replace(i, self.bedtemps[i])
f = float(l) f = float(l)
except:
self.logError(_("You must enter a temperature."))
if f>=0: if f>=0:
if self.p.online: if self.p.online:
self.p.send_now("M140 S"+l) self.p.send_now("M140 S"+l)
self.logError(_("Setting bed temperature to %s degrees Celsius.") % f) self.log(_("Setting bed temperature to %s degrees Celsius.") % f)
else: else:
self.logError(_("Printer is not online.")) self.logError(_("Printer is not online."))
else: else:
self.logError(_("You cannot set negative temperatures. To turn the bed off entirely, set its temperature to 0.")) self.logError(_("You cannot set negative temperatures. To turn the bed off entirely, set its temperature to 0."))
except:
self.logError(_("You must enter a temperature."))
def help_bedtemp(self): def help_bedtemp(self):
self.log(_("Sets the bed temperature to the value entered.")) self.log(_("Sets the bed temperature to the value entered."))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment