Loadpoint: prevent configuring more phases than physically connected (#22438)
This commit is contained in:
parent
3c226581f5
commit
11f856b1ca
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue