Loadpoint: prevent configuring more phases than physically connected (#22438)

This commit is contained in:
andig 2025-07-18 17:39:44 +02:00 • committed by GitHub
parent 3c226581f5
commit 11f856b1ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -265,6 +265,10 @@ func (lp *Loadpoint) SetPhasesConfigured(phases int) error {
return fmt.Errorf("invalid number of phases: %d", phases)
}
if physical := lp.getChargerPhysicalPhases(); physical != 0 && phases > physical {
return fmt.Errorf("cannot configure more phases than physically connected: %d > %d", phases, physical)
}
// set new default
lp.log.DEBUG.Println("set phases:", phases)