Modified API calls and subprocess calls to work with the new system

This commit is contained in:
Jared
2017-02-11 13:57:27 +00:00
parent b680ddf512
commit 9c7bf52e8f
3 changed files with 9 additions and 7 deletions
+4 -3
View File
@@ -26,7 +26,7 @@ def requires_auth(f):
@app.route('/')
def index():
return '{"onFire": false}'
return '{"onFire": false}\nGo to <a href="status">status</a>.'
@app.route('/status')
@requires_auth
@@ -37,8 +37,9 @@ def status():
@requires_auth
def users(what):
if what == "fridge":
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge", shell=True)
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge 0x20", shell=True)
elif what == "tools":
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge 0x30", shell=True)
print 'opened', what
return redirect(url_for('status'))