sports feature improvements and real time brightness control

This commit is contained in:
Neythen
2021-10-25 19:42:00 +01:00
parent a1c9c3ba8f
commit e0c8cf8c1e
19 changed files with 75 additions and 35 deletions

View File

@@ -19,8 +19,8 @@ from multiprocessing import Process
from subprocess import Popen, PIPE
import numpy as np
#stock_ticker = StockTicker()
print('API CALLER NOT STARTED')
#api_caller = pexpect.spawn("sudo -E python3 api_caller.py")
#print('API CALLER NOT STARTED')
api_caller = pexpect.spawn("sudo -E python3 api_caller.py")
command = 300
@@ -139,12 +139,16 @@ def Speed():
LastCommand = 'Change Speed'
return index()
@app.route("/Brightness", methods=['POST'])
def Brightness():
@app.route("/brightness", methods=['PUT','POST'])
def brightness():
global brightness
brightness = int(request.form['text'])-1
ticker.sendline(str(brightness))
data= request.data.decode('utf-8')
settings = json.loads(data)
print(settings)
brightness =settings['brightness']
print(str(int(brightness) - 1))
ticker.sendline(str(int(brightness) - 1))
f = open('csv/settings.csv', 'r')
CSV = csv.reader(f)