diff --git a/core/loadpoint.go b/core/loadpoint.go index 7b302e5b9a..cff269709d 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -820,7 +820,7 @@ func (lp *Loadpoint) limitEnergyReached() bool { // limitSocReached returns true if the effective limit has been reached func (lp *Loadpoint) limitSocReached() bool { limit := lp.effectiveLimitSoc() - return limit > 0 && lp.vehicleSoc >= float64(limit) + return limit > 0 && limit < 100 && lp.vehicleSoc >= float64(limit) } // minSocNotReached checks if minimum is configured and not reached. diff --git a/core/loadpoint_effective.go b/core/loadpoint_effective.go index acc0f52d2c..276947b647 100644 --- a/core/loadpoint_effective.go +++ b/core/loadpoint_effective.go @@ -110,6 +110,7 @@ func (lp *Loadpoint) effectiveLimitSoc() int { } } + // MUST return 100 here as UI looks at effectiveLimitSoc and not limitSoc (VehicleSoc.vue) return 100 } diff --git a/core/loadpoint_effective_test.go b/core/loadpoint_effective_test.go new file mode 100644 index 0000000000..888ebca281 --- /dev/null +++ b/core/loadpoint_effective_test.go @@ -0,0 +1,13 @@ +package core + +import ( + "testing" + + "github.com/evcc-io/evcc/util" + "github.com/stretchr/testify/assert" +) + +func TestEffectiveLimitSoc(t *testing.T) { + lp := NewLoadpoint(util.NewLogger("foo"), nil) + assert.Equal(t, 100, lp.effectiveLimitSoc()) +}