tobiasehlert / teslamateapi

TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON
MIT License
89 stars 20 forks source link

Doesn't start with DISABLE_MQTT=true #281

Closed nelsongraca closed 2 months ago

nelsongraca commented 4 months ago

I'm not interested in using MQTT as I don't need the status through the API, I'm only interested in using some charge commands so I tried running with DISABLE_MQTT=true

But it simply does not start, reading the code [1] shows that if MQTT is disabled it calls log.Fatalf this essentially logs and calls os.Exit(1) meaning disabling MQTT makes the applicationn unuseable, can you clarify if that is the intended behavior? If so maybe remove DISABLE_MQTT? otherwise change the log.Fatalf call.

[1] https://github.com/tobiasehlert/teslamateapi/blob/97541b3981e15b229d8c3b5a62aef141e468be22/src/webserver.go#L62C7-L62C13

tobiasehlert commented 2 months ago

Thanks for reporting @nelsongraca, I've created PR #288 to resolve this.

tobiasehlert commented 2 months ago

@nelsongraca, the fix is not in place and you can go head and test if it works as expected by pulling tobiasehlert/teslamateapi:edge.