From ff10d46a3c06ce5451685ac68153e852f6e7f17a Mon Sep 17 00:00:00 2001 From: pvtom Date: Thu, 25 Apr 2024 21:25:40 +0200 Subject: [PATCH] v1.1 --- LICENSE | 2 +- README.md | 1 + flows.json.template | 2 +- prepare.sh | 9 +++++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 849e6c0..c189822 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Thomas Heiny, Wolfsburg, Germany +Copyright (c) 2023-2024 Thomas Heiny, Wolfsburg, Germany Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b7309e2..276f7f0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ These parameters are available to configure MQTT settings: - MQTT_CLIENT_ID - MQTT_USER - MQTT_PASSWORD +- MQTT_USETLS - TOPIC_PREFIX Value ranges can be adjusted with the following parameters: diff --git a/flows.json.template b/flows.json.template index 70b28c5..44ea679 100644 --- a/flows.json.template +++ b/flows.json.template @@ -15,7 +15,7 @@ "port": "MQTT_PORT", "clientid": "MQTT_CLIENT_ID", "autoConnect": false, - "usetls": false, + "usetls": MQTT_USETLS, "protocolVersion": "4", "keepalive": "60", "cleansession": true, diff --git a/prepare.sh b/prepare.sh index ceeb4d0..a66a6a2 100755 --- a/prepare.sh +++ b/prepare.sh @@ -39,6 +39,15 @@ else sed -i "s/MQTT_CLIENT_ID/${MQTT_CLIENT_ID}/g" $1 fi +if [ -z "$MQTT_USETLS" ] +then + echo "MQTT_USETLS: >false<" + sed -i "s/MQTT_USETLS/false/g" $1 +else + echo "MQTT_USETLS: >${MQTT_USETLS}<" + sed -i "s/MQTT_USETLS/${MQTT_USETLS}/g" $1 +fi + if [ -z "$MQTT_USER" ] || [ -z "$MQTT_PASSWORD" ] then sed -i "s/MQTT_CREDENTIALS//g" $1