mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Merge pull request #761 from ingoratsdorf/main
Some checks are pending
docker / docker_dev (push) Waiting to run
Some checks are pending
docker / docker_dev (push) Waiting to run
Fix for MQTT device tracker adding quotes to payload - thanks so much @ingoratsdorf 🙏
This commit is contained in:
@@ -196,7 +196,10 @@ class sensor_config:
|
|||||||
def publish_mqtt(mqtt_client, topic, message):
|
def publish_mqtt(mqtt_client, topic, message):
|
||||||
status = 1
|
status = 1
|
||||||
|
|
||||||
|
# convert anything but a simple string to json
|
||||||
|
if not isinstance(message, str):
|
||||||
message = json.dumps(message).replace("'",'"')
|
message = json.dumps(message).replace("'",'"')
|
||||||
|
|
||||||
qos = get_setting_value('MQTT_QOS')
|
qos = get_setting_value('MQTT_QOS')
|
||||||
|
|
||||||
mylog('verbose', [f"[{pluginName}] Sending MQTT topic: {topic}"])
|
mylog('verbose', [f"[{pluginName}] Sending MQTT topic: {topic}"])
|
||||||
|
|||||||
Reference in New Issue
Block a user