diff --git a/docs/api/connection.rst b/docs/api/connection.rst index 27feb765..1caefe99 100644 --- a/docs/api/connection.rst +++ b/docs/api/connection.rst @@ -20,7 +20,7 @@ Get connection settings .. sourcecode:: http - GET /api/control/connection HTTP/1.1 + GET /api/connection HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... @@ -77,7 +77,7 @@ Issue a connection command .. sourcecode:: http - POST /api/control/connection HTTP/1.1 + POST /api/connection HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... @@ -94,7 +94,7 @@ Issue a connection command .. sourcecode:: http - POST /api/control/connection HTTP/1.1 + POST /api/connection HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... @@ -114,6 +114,6 @@ Issue a connection command Defaults to ``false`` if not set. :json boolean autoconnect: ``connect`` command: Whether to attempt to automatically connect to the printer on server startup. If not set no changes will be made to the current setting. - :statuscode 200: No error + :statuscode 204: No error :statuscode 400: If the selected `port` or `baudrate` for a ``connect`` command are not part of the available options. \ No newline at end of file diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 4679fc22..6a805d7e 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -672,7 +672,7 @@ class MachineCom(object): "file": self._currentFile.getFilename(), "filename": os.path.basename(self._currentFile.getFilename()), "origin": self._currentFile.getFileLocation(), - "time": time.time() - self._currentFile.getStartTime() + "time": self.getPrintTime() }) elif 'Done saving file' in line: self.refreshSdFiles() @@ -934,7 +934,7 @@ class MachineCom(object): payload = { "local": self._currentFile.getLocalFilename(), "remote": self._currentFile.getRemoteFilename(), - "time": time.time() - self._currentFile.getStartTime() + "time": self.getPrintTime() } self._currentFile = None @@ -947,7 +947,7 @@ class MachineCom(object): "file": self._currentFile.getFilename(), "filename": os.path.basename(self._currentFile.getFilename()), "origin": self._currentFile.getFileLocation(), - "time": time.time() - self._currentFile.getStartTime() + "time": self.getPrintTime() } self._callback.mcPrintjobDone() self._changeState(self.STATE_OPERATIONAL)