mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
intergrated everything and added simple endpoint for mqtt data
This commit is contained in:
@@ -23,6 +23,13 @@ def move():
|
||||
mqtt_client.publish("home/commands", direction) # Het topic kan aangepast worden
|
||||
|
||||
return jsonify({"status": "success", "direction": direction})
|
||||
# Run the Flask application in debug mode
|
||||
|
||||
|
||||
@app.route('/data', methods=['GET'])
|
||||
def data():
|
||||
data = mqtt_client.subscribe("kobuki/data")
|
||||
if data:
|
||||
return jsonify({data})
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
Reference in New Issue
Block a user