API Updates for AviationAssistantLink

This commit is contained in:
LAX18 Development
2022-02-25 21:38:52 -05:00
parent 70baff298d
commit 13ddd5be61
2 changed files with 42 additions and 0 deletions
+22
View File
@@ -13,6 +13,28 @@ def brightness():
status = os.popen('sudo cat /sys/class/backlight/rpi_backlight/brightness').read()
return status
@app.route('/connection',methods = ['GET'])
def connection():
if request.method == 'GET':
return "OK"
@app.route('/authentication',methods = ['POST'])
def authentication():
json = request.get_json()
if json['username'] == "npease" and json['password'] == "1118":
return "OK"
else:
return "NO"
@app.route('/information',methods = ['GET'])
def information():
ip = os.popen("ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'").read()
json = {
"name": name,
"version": version,
"ip": ip
}
return json
@app.route('/audio',methods = ['POST'])
def volume():