Fix mqtt topic spelling for minSoC and targetSoC (#616)

This commit is contained in:
andig 2021-01-26 10:38:29 +01:00 • committed by GitHub
parent c3c18a588d
commit b85c8b3f05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -503,6 +503,7 @@ The MQTT API follows the REST API's structure, with loadpoint ids starting at `0
- `evcc/loadpoints`: number of available loadpoints
- `evcc/loadpoints/<id>`: loadpoint dynamic state
- `evcc/loadpoints/<id>/mode`: loadpoint charge mode (writable)
- `evcc/loadpoints/<id>/minSoC`: loadpoint minimum SoC (writable)
- `evcc/loadpoints/<id>/targetSoC`: loadpoint target SoC (writable)
Note: to modify writable settings append `/set` to the topic for writing.

View file

@ -72,13 +72,13 @@ func (m *MQTT) listenSetters(topic string, apiHandler core.LoadPointAPI) {
m.Handler.Listen(topic+"/mode/set", func(payload string) {
apiHandler.SetMode(api.ChargeMode(payload))
})
m.Handler.Listen(topic+"/minsoc/set", func(payload string) {
m.Handler.Listen(topic+"/minSoC/set", func(payload string) {
soc, err := strconv.Atoi(payload)
if err == nil {
_ = apiHandler.SetMinSoC(soc)
}
})
m.Handler.Listen(topic+"/targetsoc/set", func(payload string) {
m.Handler.Listen(topic+"/targetSoC/set", func(payload string) {
soc, err := strconv.Atoi(payload)
if err == nil {
_ = apiHandler.SetTargetSoC(soc)