-
Notifications
You must be signed in to change notification settings - Fork 2
/
deprecated.py
27 lines (26 loc) · 938 Bytes
/
deprecated.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# @app.route('/setthreshold', methods=['POST'])
# def setpumpsetting():
# try:
# thresdata = request.get_json()
# print(thresdata)
# # config template
# # con = {"pump0": 0.0, "pump1": 0.0}
# with open('static/settings.json', 'w') as pumpcontrol:
# # json.dump(thresdata, pumpcontrol)
# pumpcontrol.write(json.dumps(thresdata))
# pumpcontrol.close()
# return jsonify({"success": True})
# except Exception as e:
# print(e)
# return jsonify({"success": False})
# @app.route('/getthreshold', methods=['GET'])
# def getpumpsetting():
# try:
# with open('static/settings.json', 'r') as pumpdata:
# pump = json.loads(pumpdata.read())
# pumpdata.close()
# print(pump)
# return jsonify(pump)
# except Exception as e:
# print(e)
# return jsonify({"success": False})