@@ -72,6 +72,7 @@ def __init__(
7272
7373 self ._running = True
7474 self ._print_status_reporter = None
75+ self ._print_temp_reporter = None
7576 self ._printer_thread = threading .Thread (
7677 target = self ._printer_worker ,
7778 name = "octoprint.plugins.bambu_printer.printer_state" ,
@@ -367,8 +368,10 @@ def _report_sd_print_status(self, data: str) -> bool:
367368 interval = int (matchS .group (1 ))
368369 if interval > 0 :
369370 self .start_continuous_status_report (interval )
371+ return False
370372 else :
371373 self .stop_continuous_status_report ()
374+ return False
372375
373376 self .report_print_job_status ()
374377 return True
@@ -403,10 +406,39 @@ def _report_temperatures(self, data: str) -> bool:
403406 self ._processTemperatureQuery ()
404407 return True
405408
409+ @gcode_executor .register ("M155" )
410+ def _auto_report_temperatures (self , data : str ) -> bool :
411+ matchS = re .search (r"S([0-9]+)" , data )
412+ if matchS :
413+ interval = int (matchS .group (1 ))
414+ if interval > 0 :
415+ self .start_continuous_temp_report (interval )
416+ else :
417+ self .stop_continuous_temp_report ()
418+
419+ self .report_print_job_status ()
420+ return True
421+
422+ def start_continuous_temp_report (self , interval : int ):
423+ if self ._print_temp_reporter is not None :
424+ self ._print_temp_reporter .cancel ()
425+
426+ self ._print_temp_reporter = RepeatedTimer (
427+ interval , self ._processTemperatureQuery
428+ )
429+ self ._print_temp_reporter .start ()
430+
431+ def stop_continuous_temp_report (self ):
432+ if self ._print_temp_reporter is not None :
433+ self ._print_temp_reporter .cancel ()
434+ self ._print_temp_reporter = None
435+
406436 # noinspection PyUnusedLocal
407437 @gcode_executor .register_no_data ("M115" )
408438 def _report_firmware_info (self ) -> bool :
409439 self .sendIO ("Bambu Printer Integration" )
440+ self .sendIO ("Cap:AUTOREPORT_SD_STATUS:1" )
441+ self .sendIO ("Cap:AUTOREPORT_TEMP:1" )
410442 self .sendIO ("Cap:EXTENDED_M20:1" )
411443 self .sendIO ("Cap:LFN_WRITE:1" )
412444 return True
0 commit comments