Skip to content

Commit 1752b82

Browse files
authored
fix MQTT_PAUSE handling outside HA environments (#15)
1 parent 7bc4fd6 commit 1752b82

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docker/mqtt.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
AUTH_HEADER="Authorization: Bearer ${SUPERVISOR_TOKEN}"
44

55
CONFIG_PATH=/data/options.json
6-
MQTT_PAUSE=$(jq -r '.mqtt_frequency // 5' $CONFIG_PATH)
76
_MQTT_HOST=$(jq -r '.mqtt_host // empty' $CONFIG_PATH)
87
# if DEBUG_MODE is set in environment variables, use environment variables, otherwise use config
98
if [ -n "$DEBUG_MODE" ]; then
109
echo "Using DEBUG_MODE from environment variables"
1110
else
1211
DEBUG_MODE=$(jq -r '.mqtt_debug // false' $CONFIG_PATH)
1312
fi
13+
if [ -n "$MQTT_PAUSE" ]; then
14+
echo "Using MQTT_PAUSE from environment variables"
15+
else
16+
MQTT_PAUSE=$(jq -r '.mqtt_frequency // 5' $CONFIG_PATH)
17+
fi
1418

1519
# if MQTT_HOST is set in environment variables, use environment variables
1620
if [ -n "$MQTT_HOST" ]; then

0 commit comments

Comments
 (0)