Documented SockJS interface, deprecated /api/state
This commit is contained in:
1 parent
587053b26c
commit
522eb40808
14 files changed
+490
-355
No files matched your search
@@ -132,11 +132,7 @@ def firstRunSetup():
|
||||
@api.route("/state", methods=["GET"])
|
||||
@restricted_access
|
||||
def apiPrinterState():
|
||||
currentData = octoprint.server.printer.getCurrentData()
|
||||
currentData.update({
|
||||
"temperatures": octoprint.server.printer.getCurrentTemperatures()
|
||||
})
|
||||
return jsonify(currentData)
|
||||
return make_response(("/api/state has been deprecated, use /api/printer instead", 405, []))
|
||||
|
||||
|
||||
#~~ system control
|
||||
|
||||
@@ -53,5 +53,5 @@ def jobState():
|
||||
return jsonify({
|
||||
"job": currentData["job"],
|
||||
"progress": currentData["progress"],
|
||||
"state": currentData["state"]["stateString"]
|
||||
"state": currentData["state"]["text"]
|
||||
})
|
||||
@@ -38,10 +38,7 @@ def printerState():
|
||||
# add state information
|
||||
if not "state" in excludes:
|
||||
state = printer.getCurrentData()["state"]
|
||||
result.update({"state": {
|
||||
"text": state["stateString"],
|
||||
"flags": state["flags"]
|
||||
}})
|
||||
result.update({"state": state})
|
||||
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
Reference in new issue
Block a user