mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
Refactor move function to publish direction from request form
This commit is contained in:
@@ -15,7 +15,8 @@ def index():
|
||||
|
||||
@app.route('/move', methods=['POST'])
|
||||
def move():
|
||||
result = mqtt_client.publish("home/commands", "Knop ingedrukt!")
|
||||
direction = request.form['direction']
|
||||
result = mqtt_client.publish("home/commands", direction)
|
||||
if result.rc == mqtt.MQTT_ERR_SUCCESS:
|
||||
print("Bericht succesvol gepubliceerd")
|
||||
else:
|
||||
|
Reference in New Issue
Block a user