From 23468384d2455e2d19673fde0af8ee2a7b8eb2c1 Mon Sep 17 00:00:00 2001 From: marcsello Date: Sat, 19 Sep 2020 16:35:21 +0200 Subject: [PATCH] Fixed messages not arriving --- src/app.py | 2 ++ src/mqtt_methods.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index a451a35..6e1d6e6 100644 --- a/src/app.py +++ b/src/app.py @@ -11,6 +11,8 @@ from db import db from marshm import ma from mqtt_flask_instance import mqtt +import mqtt_methods # This file contains a decorator + """ Main Flask RESTful API """ diff --git a/src/mqtt_methods.py b/src/mqtt_methods.py index 0fe6269..d26d4d4 100644 --- a/src/mqtt_methods.py +++ b/src/mqtt_methods.py @@ -20,7 +20,7 @@ sensorschema = SensorSchema(many=False) LOGGER = logging.getLogger(__name__) -@mqtt.on_message() +@mqtt.on_topic(f"{config.MQTT_STATUS_TOPIC}/#") def handle_status_message(client, userdata, message): data = dict( topic=message.topic,