json decode msg
This commit is contained in:
parent
8c208c0028
commit
b329580ff0
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue