From 2799c23b0bd9c3876817473d559fb106f39a9231 Mon Sep 17 00:00:00 2001 From: jneilliii Date: Mon, 8 Jan 2024 23:27:25 -0500 Subject: [PATCH] 0.0.2 only report chamber temp if printer profile has it enabled --- octoprint_bambu_printer/virtual.py | 18 +++++++++++++++--- setup.py | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/octoprint_bambu_printer/virtual.py b/octoprint_bambu_printer/virtual.py index 185e372..7a48861 100644 --- a/octoprint_bambu_printer/virtual.py +++ b/octoprint_bambu_printer/virtual.py @@ -463,6 +463,11 @@ class BambuPrinter: self._pauseSdPrint() return True + def _gcode_M524(self, data: str) -> bool: + if self._sdCardReady: + self._cancelSdPrint() + return False + def _gcode_M26(self, data: str) -> bool: self._logger.debug("ignoring M26 command.") self._send("M26 disabled for Bambu") @@ -682,6 +687,13 @@ class BambuPrinter: else: self._logger.info("print pause failed") + def _cancelSdPrint(self): + if self.bambu.connected: + if self.bambu.publish(commands.STOP): + self._logger.info("print cancelled") + else: + self._logger.info("print cancel failed") + def _setSdPos(self, pos): self._newSdFilePos = pos @@ -694,10 +706,10 @@ class BambuPrinter: def _generateTemperatureOutput(self) -> str: template = "{heater}:{actual:.2f}/ {target:.2f}" temps = collections.OrderedDict() - heater = "T" - temps[heater] = (self.temp[0], self.targetTemp[0]) + temps["T"] = (self.temp[0], self.targetTemp[0]) temps["B"] = (self.bedTemp, self.bedTargetTemp) - temps["C"] = (self.chamberTemp, self.chamberTargetTemp) + if self._printer_profile_manager.get_current().get("heatedChamber"): + temps["C"] = (self.chamberTemp, self.chamberTargetTemp) output = " ".join( map( diff --git a/setup.py b/setup.py index bff221d..ee1be6a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_package = "octoprint_bambu_printer" plugin_name = "OctoPrint-BambuPrinter" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.0.1" +plugin_version = "0.0.2" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module