Loadpoint: detect connection changes using connected duration (attempt 2) (#24957)

This commit is contained in:
Sam Feyaerts 2025-11-02 13:19:57 +01:00 • committed by GitHub
parent 0bcca69b8e
commit 3a24dd0948
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 251 additions and 41 deletions

View file

@ -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)