Loadpoint: detect connection changes using connected duration (attempt 2) (#24957)
This commit is contained in:
parent
0bcca69b8e
commit
3a24dd0948
6 changed files with 251 additions and 41 deletions
|
|
@ -7,7 +7,7 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
//go:generate go tool mockgen -package api -destination mock.go github.com/evcc-io/evcc/api Charger,ChargeState,CurrentLimiter,CurrentGetter,PhaseSwitcher,PhaseGetter,FeatureDescriber,Identifier,Meter,MeterEnergy,PhaseCurrents,Vehicle,ChargeRater,Battery,BatteryController,BatterySocLimiter,Circuit,Tariff
|
||||
//go:generate go tool mockgen -package api -destination mock.go github.com/evcc-io/evcc/api Charger,ChargeState,CurrentLimiter,CurrentGetter,PhaseSwitcher,PhaseGetter,FeatureDescriber,Identifier,Meter,MeterEnergy,PhaseCurrents,Vehicle,ConnectionTimer,ChargeRater,Battery,BatteryController,BatterySocLimiter,Circuit,Tariff
|
||||
|
||||
// Meter provides total active power in W
|
||||
type Meter interface {
|
||||
|
|
@ -115,6 +115,11 @@ type ChargeTimer interface {
|
|||
ChargeDuration() (time.Duration, error)
|
||||
}
|
||||
|
||||
// ConnectionTimer provides current connection duration
|
||||
type ConnectionTimer interface {
|
||||
ConnectionDuration() (time.Duration, error)
|
||||
}
|
||||
|
||||
// ChargeRater provides charged energy amount in kWh
|
||||
type ChargeRater interface {
|
||||
ChargedEnergy() (float64, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue