mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-07 23:17:37 -06:00
heater: Return heaters with a gcode_id from new get_gcode_sensors()
The gcode.py code should not peek into the heater classes to obtain the gcode_id. Instead, introduce a new get_gcode_sensors() so that the gcode.py code does not need to. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
bb4fab5570
commit
c54c81dc2a
2 changed files with 11 additions and 9 deletions
|
@ -373,9 +373,9 @@ class GCodeParser:
|
|||
# Tn:XXX /YYY B:XXX /YYY
|
||||
out = []
|
||||
if self.heaters is not None:
|
||||
for heater in self.heaters.get_all_heaters():
|
||||
cur, target = heater.get_temp(eventtime)
|
||||
out.append("%s:%.1f /%.1f" % (heater.gcode_id, cur, target))
|
||||
for gcode_id, sensor in sorted(self.heaters.get_gcode_sensors()):
|
||||
cur, target = sensor.get_temp(eventtime)
|
||||
out.append("%s:%.1f /%.1f" % (gcode_id, cur, target))
|
||||
if not out:
|
||||
return "T:0"
|
||||
return " ".join(out)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue