mirror of
https://git.centos.org/centos-git-common.git
synced 2025-02-23 08:12:56 +00:00
Fix mqtt message so the json isn't double escaped
This commit is contained in:
parent
8a81bc8622
commit
dc7af13b6c
1 changed files with 1 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue