Document backup pipeline behaviour

This commit is contained in:
Codex authored and zorruno committed 2026-09-26 17:51:26 +12:00
1 parent 22acd4f20c
commit 5d07cc4f54
10 files changed
+80 -8

No files matched your search

+4
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
# Shared mosquitto_pub/mosquitto_sub argument construction.
# Passwords are read from a protected file rather than placed in .env or Git.
mqtt_common_args() {
MQTT_ARGS=(-h "$MQTT_HOST" -p "$MQTT_PORT")
@@ -14,6 +16,8 @@ mqtt_publish() {
[[ -n "$MQTT_HOST" ]] || die "MQTT_HOST is not configured"
require_command mosquitto_pub
mqtt_common_args
# Backup state is retained so Home Assistant receives the latest result after
# reconnecting. Command messages are handled separately and are never kept.
(( retain )) && MQTT_ARGS+=(-r)
mosquitto_pub "${MQTT_ARGS[@]}" -t "$topic" -m "$payload"
}