Merge pull request #761 from ingoratsdorf/main

Fix for MQTT device tracker adding quotes to payload - thanks so much @ingoratsdorf  🙏
This commit is contained in:
jokob-sk authored and GitHub committed 2024-08-13 08:35:31 +10:00
commit c3f91cae9e
1 file changed
+4 -1
+4 -1
View File
@@ -196,7 +196,10 @@ class sensor_config:
def publish_mqtt(mqtt_client, topic, message):
status = 1
message = json.dumps(message).replace("'",'"')
# convert anything but a simple string to json
if not isinstance(message, str):
message = json.dumps(message).replace("'",'"')
qos = get_setting_value('MQTT_QOS')
mylog('verbose', [f"[{pluginName}] Sending MQTT topic: {topic}"])