base_panel: fix error from trying to update temps before the printer initializes
This commit is contained in:
parent
1dee914564
commit
50e72b0308
@ -246,14 +246,16 @@ class BasePanel(ScreenPanel):
|
|||||||
if action != "notify_status_update" or self._printer is None:
|
if action != "notify_status_update" or self._printer is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
for device in self._printer.get_temp_store_devices():
|
devices = self._printer.get_temp_store_devices()
|
||||||
name = ""
|
if devices is not None:
|
||||||
if not (device.startswith("extruder") or device.startswith("heater_bed")):
|
for device in devices:
|
||||||
if self.titlebar_name_type == "full":
|
name = ""
|
||||||
name = device.split(" ")[1:][0].capitalize().replace("_", " ") + ": "
|
if not (device.startswith("extruder") or device.startswith("heater_bed")):
|
||||||
elif self.titlebar_name_type == "short":
|
if self.titlebar_name_type == "full":
|
||||||
name = device.split(" ")[1:][0][:1].upper() + ": "
|
name = device.split(" ")[1:][0].capitalize().replace("_", " ") + ": "
|
||||||
self.labels[device].set_label("%s%d°" % (name, round(self._printer.get_dev_stat(device, "temperature"))))
|
elif self.titlebar_name_type == "short":
|
||||||
|
name = device.split(" ")[1:][0][:1].upper() + ": "
|
||||||
|
self.labels[device].set_label("%s%d°" % (name, round(self._printer.get_dev_stat(device, "temperature"))))
|
||||||
|
|
||||||
if "toolhead" in data and "extruder" in data["toolhead"]:
|
if "toolhead" in data and "extruder" in data["toolhead"]:
|
||||||
if data["toolhead"]["extruder"] != self.current_extruder:
|
if data["toolhead"]["extruder"] != self.current_extruder:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user