Open fridge from site

master
Jared 8 years ago
parent 1bfb5f5b35
commit 1d1e6a3ec7

@ -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'))

Loading…
Cancel
Save