ABB: add keep-alive (#3979)

This commit is contained in:
andig 2022-07-28 21:28:15 +02:00 • committed by GitHub
parent 378a8718c2
commit 7bed4edcd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,7 @@ package charger
import (
"encoding/binary"
"fmt"
"time"
"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/util"
@ -90,6 +91,13 @@ func NewABB(uri, device, comset string, baudrate int, slaveID uint8) (api.Charge
curr: abbMinCurrent, // assume min current
}
// keep-alive
go func() {
for range time.NewTicker(30 * time.Second).C {
_, _ = wb.status()
}
}()
return wb, err
}