Loadpoint: don't disable at limitsoc 100% (#11348)
This commit is contained in:
parent
8ed21de3df
commit
8758fe0ead
3 changed files with 15 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
13
core/loadpoint_effective_test.go
Normal file
13
core/loadpoint_effective_test.go
Normal file
|
|
@ -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())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue