Include temperature_sensor in listing of temperatures

This update will add temperature sensors to the main menu and 
temperature panels.
This commit is contained in:
Jordan 2021-05-08 14:31:50 -04:00
parent c2c4e9c42e
commit 7b9c98a0a8
3 changed files with 9 additions and 2 deletions

View File

@ -54,11 +54,13 @@ class Printer:
if "shared_heater" in self.config[x]:
continue
self.extrudercount += 1
if x.startswith('heater_bed') or x.startswith('heater_generic '):
if x == 'heater_bed' or x.startswith('heater_generic ') or x.startswith('temperature_sensor '):
logging.info("X: %s" % x)
self.devices[x] = {
"temperature": 0,
"target": 0
}
logging.info("self.devices: %s" % self.devices)
if x.startswith('bed_mesh '):
r = self.config[x]
r['x_count'] = int(r['x_count'])
@ -181,6 +183,8 @@ class Printer:
heaters.append("heater_bed")
for h in self.get_config_section_list("heater_generic "):
heaters.append(h)
for h in self.get_config_section_list("temperature_sensor "):
heaters.append(h)
return heaters
def get_printer_status_data(self):

View File

@ -34,6 +34,8 @@ class PreheatPanel(ScreenPanel):
add_heaters = self._printer.get_heaters()
for h in add_heaters:
if h.startswith("temperature_sensor "):
continue
if h == "heater_bed":
self.labels[h] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
else:

View File

@ -49,6 +49,7 @@ class TemperaturePanel(ScreenPanel):
i = 0
cols = 3 if len(self.heaters) > 4 else (1 if len(self.heaters) <= 2 else 2)
for h in self.heaters:
if not (h.startswith("temperature_sensor")):
self.labels[h].connect('clicked', self.select_heater, h)
eq_grid.attach(self.labels[h], i%cols, int(i/cols), 1, 1)
i += 1