Revert "Loadpoint: detect connection changes using connected duration (#24730)"

This reverts commit c023b080d6.
This commit is contained in:
andig 2025-11-01 10:47:00 +01:00
parent 06b92eb0cb
commit d475326e2f
6 changed files with 50 additions and 201 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,ConnectionTimer,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,ChargeRater,Battery,BatteryController,BatterySocLimiter,Circuit,Tariff
// Meter provides total active power in W
type Meter interface {
@ -115,11 +115,6 @@ 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)

View file

@ -1,9 +1,9 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/evcc-io/evcc/api (interfaces: Charger,ChargeState,CurrentLimiter,CurrentGetter,PhaseSwitcher,PhaseGetter,FeatureDescriber,Identifier,Meter,MeterEnergy,PhaseCurrents,Vehicle,ConnectionTimer,ChargeRater,Battery,BatteryController,BatterySocLimiter,Circuit,Tariff)
// Source: github.com/evcc-io/evcc/api (interfaces: Charger,ChargeState,CurrentLimiter,CurrentGetter,PhaseSwitcher,PhaseGetter,FeatureDescriber,Identifier,Meter,MeterEnergy,PhaseCurrents,Vehicle,ChargeRater,Battery,BatteryController,BatterySocLimiter,Circuit,Tariff)
//
// Generated by this command:
//
// 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
// 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
//
// Package api is a generated GoMock package.
@ -11,7 +11,6 @@ package api
import (
reflect "reflect"
time "time"
gomock "go.uber.org/mock/gomock"
)
@ -638,45 +637,6 @@ func (mr *MockVehicleMockRecorder) Soc() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Soc", reflect.TypeOf((*MockVehicle)(nil).Soc))
}
// MockConnectionTimer is a mock of ConnectionTimer interface.
type MockConnectionTimer struct {
ctrl *gomock.Controller
recorder *MockConnectionTimerMockRecorder
isgomock struct{}
}
// MockConnectionTimerMockRecorder is the mock recorder for MockConnectionTimer.
type MockConnectionTimerMockRecorder struct {
mock *MockConnectionTimer
}
// NewMockConnectionTimer creates a new mock instance.
func NewMockConnectionTimer(ctrl *gomock.Controller) *MockConnectionTimer {
mock := &MockConnectionTimer{ctrl: ctrl}
mock.recorder = &MockConnectionTimerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockConnectionTimer) EXPECT() *MockConnectionTimerMockRecorder {
return m.recorder
}
// ConnectionDuration mocks base method.
func (m *MockConnectionTimer) ConnectionDuration() (time.Duration, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ConnectionDuration")
ret0, _ := ret[0].(time.Duration)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ConnectionDuration indicates an expected call of ConnectionDuration.
func (mr *MockConnectionTimerMockRecorder) ConnectionDuration() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionDuration", reflect.TypeOf((*MockConnectionTimer)(nil).ConnectionDuration))
}
// MockChargeRater is a mock of ChargeRater interface.
type MockChargeRater struct {
ctrl *gomock.Controller