From 07451d01886d7abf9769a156a71445e1ac443ae6 Mon Sep 17 00:00:00 2001 From: "ishak jmilou.ishak" Date: Wed, 23 Oct 2024 17:03:42 +0200 Subject: [PATCH] fixed error --- src/Python/flask/web/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Python/flask/web/app.py b/src/Python/flask/web/app.py index 0383626..7d07c0a 100644 --- a/src/Python/flask/web/app.py +++ b/src/Python/flask/web/app.py @@ -12,13 +12,12 @@ mqtt_client.loop_start() @app.route('/', methods=['GET', 'POST']) def index(): + message = '' if request.method == 'POST': direction = request.form['direction'] result = mqtt_client.publish("home/commands", direction) if result.rc == mqtt.MQTT_ERR_SUCCESS: message = "Bericht succesvol gepubliceerd" - else: - message = "Fout bij het publiceren van bericht" return render_template('index.html', message=message) if __name__ == '__main__':