TWC3: add ConnectionTimer to detect vehicle swaps (#27346)

This commit is contained in:
Adam Petrovic 2026-02-11 17:55:12 +11:00 • committed by GitHub
parent 1cf73a8f09
commit 714093a505
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,6 +165,14 @@ func (v *Twc3) ChargedEnergy() (float64, error) {
return res.SessionEnergyWh / 1e3, err
}
var _ api.ConnectionTimer = (*Twc3)(nil)
// ConnectionDuration implements the api.ConnectionTimer interface
func (v *Twc3) ConnectionDuration() (time.Duration, error) {
res, err := v.vitalsG()
return time.Duration(res.SessionS) * time.Second, err
}
// removed: https://github.com/evcc-io/evcc/issues/13555
// var _ api.ChargeTimer = (*Twc3)(nil)