From 714093a5059240e0cfd13cacf201391c8f9ddd14 Mon Sep 17 00:00:00 2001 From: Adam Petrovic Date: Wed, 11 Feb 2026 17:55:12 +1100 Subject: [PATCH] TWC3: add ConnectionTimer to detect vehicle swaps (#27346) --- charger/twc3.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charger/twc3.go b/charger/twc3.go index 016fb4910..66f3c3f9f 100644 --- a/charger/twc3.go +++ b/charger/twc3.go @@ -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)