From dc7af13b6cad543db5c1e3e557b522197972faf7 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: May 24 2019 14:06:44 +0000 Subject: Fix mqtt message so the json isn't double escaped --- diff --git a/mqtt/send-mqtt-to-dbus.py b/mqtt/send-mqtt-to-dbus.py index 604cf22..d98ba20 100755 --- a/mqtt/send-mqtt-to-dbus.py +++ b/mqtt/send-mqtt-to-dbus.py @@ -165,7 +165,7 @@ def on_mqtt_message(client, userdata, message): logging.debug('Message received topic:%s payload:%s', message.topic, message.payload.decode("utf-8")) # Or you can customize this to fit your needs - signal = {message.topic: message.payload.decode("utf-8")} + signal = {message.topic: json.loads(message.payload.decode("utf-8"))} userdata['emit'].message(json.dumps((signal))) logging.debug('Sending signal: %s', json.dumps(signal))