json decode msg

This commit is contained in:
Fabio Manganiello 2018-06-12 09:28:10 +02:00
parent 8c208c0028
commit b329580ff0

View file

@ -34,6 +34,11 @@ class MqttBackend(Backend):
def send_message(self, msg): def send_message(self, msg):
try:
msg = json.loads(msg)
except:
pass
publisher.single(self.topic, str(msg), hostname=self.host, port=self.port) publisher.single(self.topic, str(msg), hostname=self.host, port=self.port)