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,