main and temp: fix same color for heater_generics and sensors

This commit is contained in:
alfrix 2022-04-02 11:40:37 -03:00
parent ab38dab291
commit e09d72f12d
2 changed files with 8 additions and 8 deletions

View File

@ -91,12 +91,12 @@ class MainPanel(MenuPanel):
class_name = "graph_label_heater_bed" class_name = "graph_label_heater_bed"
type = "bed" type = "bed"
elif device.startswith("heater_generic"): elif device.startswith("heater_generic"):
h = 1 self.h = 1
for d in self.devices: for d in self.devices:
if "heater_generic" in d: if "heater_generic" in d:
h += 1 self.h += 1
image = "heater" image = "heater"
class_name = "graph_label_sensor_%s" % h class_name = "graph_label_sensor_%s" % self.h
type = "sensor" type = "sensor"
elif device.startswith("temperature_fan"): elif device.startswith("temperature_fan"):
f = 1 f = 1
@ -111,7 +111,7 @@ class MainPanel(MenuPanel):
else: else:
s = 1 s = 1
try: try:
s += h s += self.h
except Exception: except Exception:
pass pass
for d in self.devices: for d in self.devices:

View File

@ -297,12 +297,12 @@ class TemperaturePanel(ScreenPanel):
class_name = "graph_label_heater_bed" class_name = "graph_label_heater_bed"
type = "bed" type = "bed"
elif device.startswith("heater_generic"): elif device.startswith("heater_generic"):
h = 1 self.h = 1
for d in self.devices: for d in self.devices:
if "heater_generic" in d: if "heater_generic" in d:
h += 1 self.h += 1
image = "heater" image = "heater"
class_name = "graph_label_sensor_%s" % h class_name = "graph_label_sensor_%s" % self.h
type = "sensor" type = "sensor"
elif device.startswith("temperature_fan"): elif device.startswith("temperature_fan"):
f = 1 f = 1
@ -317,7 +317,7 @@ class TemperaturePanel(ScreenPanel):
else: else:
s = 1 s = 1
try: try:
s += h s += self.h
except Exception: except Exception:
pass pass
for d in self.devices: for d in self.devices: