Verified Commit e39769fe authored by Grégor JOUET's avatar Grégor JOUET 🔧
Browse files

Detect normal print ending

parent ab34f9b2
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -574,9 +574,12 @@ class OctoPrinter(PrinterBase):
            "job": None
        }
        self.log(f"Status is \"{status['state']['text']}\"")
        # TODO: Event feed
        # TODO detect print ending

        if not status["state"]["flags"]["printing"]:
            if self.current_print != None:
                # We just finished a print, check the reason;
                # set the print status and remove current print
                self.reset_current_print(RESET_ERROR if status["state"]["flags"]["error"] else RESET_SUCCESS)  
            return

        job = self._make_octoprint_raw_request("/api/job")