job_status and base_panel: safeguard against possible issues with temps

This commit is contained in:
alfrix authored and Alfredo Monclus committed 2022-07-03 12:03:50 -03:00
1 parent 784253ca77
commit d3cd4008a8
2 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -230,7 +230,7 @@ class BasePanel(ScreenPanel):
if devices is not None:
for device in devices:
temp = self._screen.printer.get_dev_stat(device, "temperature")
if temp is not None:
if temp is not None and device in self.labels:
name = ""
if not (device.startswith("extruder") or device.startswith("heater_bed")):
if self.titlebar_name_type == "full":
+5 -4
View File
@@ -932,7 +932,8 @@ class JobStatusPanel(ScreenPanel):
self.labels['lcdmessage'].set_text(str(msg))
def update_temp(self, x, temp, target):
if target > 0:
self.labels[x].set_label("%3d/%3d°" % (temp, target))
else:
self.labels[x].set_label("%3d°" % temp)
if x in self.labels and temp is not None:
if target is not None and target > 0:
self.labels[x].set_label("%3d/%3d°" % (temp, target))
else:
self.labels[x].set_label("%3d°" % temp)