Fixed messages not arriving

This commit is contained in:
Pünkösd Marcell 2020-09-19 16:35:21 +02:00
parent bdf0710889
commit 23468384d2
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,8 @@ from db import db
from marshm import ma from marshm import ma
from mqtt_flask_instance import mqtt from mqtt_flask_instance import mqtt
import mqtt_methods # This file contains a decorator
""" """
Main Flask RESTful API Main Flask RESTful API
""" """

View File

@ -20,7 +20,7 @@ sensorschema = SensorSchema(many=False)
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
@mqtt.on_message() @mqtt.on_topic(f"{config.MQTT_STATUS_TOPIC}/#")
def handle_status_message(client, userdata, message): def handle_status_message(client, userdata, message):
data = dict( data = dict(
topic=message.topic, topic=message.topic,