mirror of
https://github.com/tobiasehlert/teslamateapi.git
synced 2026-02-27 09:54:18 +08:00
fix: resolving fatal when disabling of mqtt (#288)
This commit is contained in:
+6
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user