From 12c4e6302266ba3237c01787d3d72441e8a21bbb Mon Sep 17 00:00:00 2001 From: "ishak jmilou.ishak" Date: Tue, 17 Dec 2024 14:48:39 +0100 Subject: [PATCH] test --- src/Python/flask/web/app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Python/flask/web/app.py b/src/Python/flask/web/app.py index 9a7b4df..4a5ef76 100644 --- a/src/Python/flask/web/app.py +++ b/src/Python/flask/web/app.py @@ -52,6 +52,13 @@ def control(): def move(): data = request.get_json() direction = data.get("direction") + + db_connection = get_db() + cursor = db_connection.cursor() + cursor.execute("INSERT INTO command (direction) VALUES (%s)", (direction,)) + db_connection.commit() + cursor.close() + db_connection.close() # Verstuur de richting via MQTT if direction: