extrude: add filament sensor support

This commit is contained in:
alfrix
2022-05-12 15:42:56 -03:00
committed by Alfredo Monclus
parent b77b7c0976
commit 7c8d4ea4d7
4 changed files with 106 additions and 26 deletions

View File

@@ -125,7 +125,7 @@ class Printer:
'motion_report'
]
for x in (self.get_tools() + self.get_heaters()):
for x in (self.get_tools() + self.get_heaters() + self.get_filament_sensors()):
if x in data:
for i in data[x]:
self.set_dev_stat(x, i, data[x][i])
@@ -242,6 +242,14 @@ class Printer:
heaters.append(h)
return heaters
def get_filament_sensors(self):
sensors = []
for s in self.get_config_section_list("filament_switch_sensor "):
sensors.append(s)
for s in self.get_config_section_list("filament_motion_sensor "):
sensors.append(s)
return sensors
def get_printer_status_data(self):
data = {
"printer": {