This commit is contained in:
karl.hudgell 2021-10-26 10:39:04 +01:00
parent b1e002ddf7
commit f1147be300
2 changed files with 14 additions and 2 deletions

View File

@ -15,6 +15,7 @@ pexpect==4.8.0
platformdirs==2.4.0 platformdirs==2.4.0
ptyprocess==0.7.0 ptyprocess==0.7.0
regex==2021.10.23 regex==2021.10.23
tenacity==8.0.1
tomli==1.2.2 tomli==1.2.2
typed-ast==1.4.3 typed-ast==1.4.3
typing-extensions==3.10.0.2 typing-extensions==3.10.0.2

View File

@ -5,9 +5,20 @@ from colormap import rgb2hex
app = Flask(__name__) app = Flask(__name__)
@app.route("/") @app.route("/on")
def index(): def index():
return "Index Page" os.system(
f"gatttool -i hci0 -b b2:3b:03:00:14:d6 --char-write-req -a 0x0009 -n cc2333"
)
return "On"
@app.route("/off")
def index():
os.system(
f"gatttool -i hci0 -b b2:3b:03:00:14:d6 --char-write-req -a 0x0009 -n cc2433"
)
return "Off"
@app.route("/colour") @app.route("/colour")