sports feature improvements and real time brightness control
This commit is contained in:
18
server.py
18
server.py
@@ -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)
|
||||
|
Reference in New Issue
Block a user