Added system lock feature

This commit is contained in:
Jared
2017-04-01 20:19:53 +00:00
parent d99f70433a
commit b726139474
6 changed files with 54 additions and 9 deletions
+14
View File
@@ -37,6 +37,20 @@ def help():
def status():
return render_template('status.html')
@app.route('/lock-fridge/<duration>')
@requires_auth
def lock_fridge(duration):
with open('locked_till.txt', 'wb') as f:
f.write(str(time.time() + float(duration) * 3600))
return '{"success":true}'
@app.route('/unlock-fridge')
@requires_auth
def unlock_fridge():
with open('locked_till.txt', 'wb') as f:
f.write('0')
return '{"success":true}'
@app.route('/open/<what>')
@requires_auth
def users(what):