Loadpoint: fix phase switching incorrectly configured

This commit is contained in:
andig 2025-03-19 14:09:27 +01:00
parent cf97ac2357
commit 49a597a5da

View file

@ -188,12 +188,6 @@ func NewLoadpointFromConfig(log *util.Logger, settings settings.Settings, other
lp.Soc.Poll.Mode = loadpoint.PollCharging
}
// phase switching defaults based on charger capabilities
if !lp.hasPhaseSwitching() {
lp.phasesConfigured = 3
lp.phases = 3
}
// validate thresholds
if lp.Enable.Threshold > lp.Disable.Threshold {
lp.log.WARN.Printf("PV mode enable threshold (%.0fW) is larger than disable threshold (%.0fW)", lp.Enable.Threshold, lp.Disable.Threshold)
@ -250,6 +244,12 @@ func NewLoadpointFromConfig(log *util.Logger, settings settings.Settings, other
lp.charger = dev.Instance()
lp.configureChargerType(lp.charger)
// phase switching defaults based on charger capabilities
if !lp.hasPhaseSwitching() {
lp.phasesConfigured = 3
lp.phases = 3
}
return lp, nil
}