ABB: add keep-alive (#3979)
This commit is contained in:
parent
378a8718c2
commit
7bed4edcd7
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue