Added system lock feature
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user