Documented SockJS interface, deprecated /api/state

This commit is contained in:
Gina Häußge committed 2014-06-08 16:52:28 +02:00
1 parent 587053b26c
commit 522eb40808
14 files changed
+490 -355

No files matched your search

+1 -5
View File
@@ -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
+1 -1
View File
@@ -53,5 +53,5 @@ def jobState():
return jsonify({
"job": currentData["job"],
"progress": currentData["progress"],
"state": currentData["state"]["stateString"]
"state": currentData["state"]["text"]
})
+1 -4
View File
@@ -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)