fix: resolving fatal when disabling of mqtt (#288)

This commit is contained in:
Tobias Lindberg
2024-06-19 12:11:32 +02:00
committed by GitHub
parent f7ac2f7f00
commit 6cf37c5a29
+6 -2
View File
@@ -58,8 +58,12 @@ func main() {
// Connect to the MQTT broker
statusCache, err := startMQTT()
if err != nil {
log.Fatalf("[error] TeslaMateApi MQTT connection failed: %s", err)
if getEnvAsBool("DISABLE_MQTT", false) {
log.Printf("[info] TeslaMateApi MQTT connection not established.")
} else {
if err != nil {
log.Fatalf("[error] TeslaMateApi MQTT connection failed: %s", err)
}
}
if getEnvAsBool("API_TOKEN_DISABLE", false) {