Loadpoint: fix 1p3p charger not updating physical state if phase config not set to auto (#18637)

This commit is contained in:
andig 2025-02-06 23:47:59 +01:00 • committed by GitHub
parent 09e47b07c2
commit dd2af01e53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -338,7 +338,10 @@ func (lp *Loadpoint) restoreSettings() {
}
if v, err := lp.settings.Int(keys.Phases); err == nil && (v > 0 || lp.hasPhaseSwitching()) {
lp.setConfiguredPhases(int(v))
lp.phases = lp.configuredPhases
// for 1p3p charger, we don't know the physical state yet (phases == 0), so don't touch it
if !lp.hasPhaseSwitching() {
lp.phases = lp.configuredPhases
}
}
if v, err := lp.settings.Float(keys.MinCurrent); err == nil && v > 0 {
lp.setMinCurrent(v)