diff --git a/docs/api/job.rst b/docs/api/job.rst index f16cdd3e..4b34df65 100644 --- a/docs/api/job.rst +++ b/docs/api/job.rst @@ -130,7 +130,7 @@ Retrieve information about the current job } }, "progress": { - "completion": 23, + "completion": 0.2298468264184775, "filepos": 337942, "printTime": 276, "printTimeLeft": 912 @@ -231,7 +231,7 @@ Progress information - Description * - ``completion`` - 1 - - Integer + - Float - Percentage of completion of the current print job * - ``filepos`` - 1 diff --git a/src/octoprint/printer.py b/src/octoprint/printer.py index d53231f1..cb195d9b 100644 --- a/src/octoprint/printer.py +++ b/src/octoprint/printer.py @@ -291,7 +291,7 @@ class Printer(): self._printTimeLeft = printTimeLeft self._stateMonitor.setProgress({ - "completion": int(self._progress * 100) if self._progress is not None else None, + "completion": self._progress * 100 if self._progress is not None else None, "filepos": filepos, "printTime": int(self._printTime) if self._printTime is not None else None, "printTimeLeft": int(self._printTimeLeft * 60) if self._printTimeLeft is not None else None @@ -564,6 +564,9 @@ class Printer(): } } + def getTemperatureHistory(self): + return self._temps + def getCurrentConnection(self): if self._comm is None: return "Closed", None, None diff --git a/src/octoprint/server/api/files.py b/src/octoprint/server/api/files.py index 23cafad9..c704faf2 100644 --- a/src/octoprint/server/api/files.py +++ b/src/octoprint/server/api/files.py @@ -11,7 +11,7 @@ import octoprint.util as util from octoprint.filemanager.destinations import FileDestinations from octoprint.settings import settings, valid_boolean_trues from octoprint.server import printer, gcodeManager, eventManager, restricted_access, NO_CONTENT -from octoprint.server.util import redirectToTornado, urlForDownload +from octoprint.server.util import urlForDownload from octoprint.server.api import api