diff --git a/src/mqtt_methods.py b/src/mqtt_methods.py index aa9fbc3..055aa30 100644 --- a/src/mqtt_methods.py +++ b/src/mqtt_methods.py @@ -21,12 +21,10 @@ def handle_status_message(client, userdata, message): try: ids = data['topic'].replace(f"{config.MQTT_STATUS_TOPIC}/", "").split("/") if len(ids) == 1: - data['payload']['deviceID'] = ids[0] - app.logger.info(f"Recieved status message from {data['payload']['deviceID']}, persisting to db.") + app.logger.info(f"Recieved status message from {ids[0]} it was: {data['payload']}.") else: if len(ids) == 2: - data['payload']['deviceID'] = ids[0] - data['payload']['sensorID'] = ids[1] - app.logger.info(f"Recieved status message from sensor {data['payload']['sensorID']}, persisting to db.") + app.logger.info( + f"Recieved status message from sensor {ids[1]} on device {ids[0]} it was: {data['payload']}.") except Exception as e: app.logger.exception(e)