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: