From b329580ff0ce7ae93cc83eccf7fcc181e4a7a948 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 12 Jun 2018 09:28:10 +0200 Subject: [PATCH] json decode msg --- platypush/backend/mqtt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platypush/backend/mqtt.py b/platypush/backend/mqtt.py index 126ac7d4e..c0d250307 100644 --- a/platypush/backend/mqtt.py +++ b/platypush/backend/mqtt.py @@ -34,6 +34,11 @@ class MqttBackend(Backend): def send_message(self, msg): + try: + msg = json.loads(msg) + except: + pass + publisher.single(self.topic, str(msg), hostname=self.host, port=self.port)