This commit is contained in:
ishak jmilou.ishak
2024-12-17 14:48:39 +01:00
parent 9ea6ed5e2d
commit 12c4e63022

View File

@@ -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: