Open fridge from site
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from functools import wraps
|
||||
from flask import Flask
|
||||
from flask import render_template, send_from_directory, request, Response, redirect, url_for
|
||||
import json, time
|
||||
import json, time, subprocess
|
||||
app = Flask(__name__)
|
||||
|
||||
def check_auth(username, password):
|
||||
@@ -36,6 +36,9 @@ def status():
|
||||
@app.route('/open/<what>')
|
||||
@requires_auth
|
||||
def users(what):
|
||||
if what == "fridge":
|
||||
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge", shell=True)
|
||||
|
||||
print 'opened', what
|
||||
return redirect(url_for('status'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user