From 11f856b1ca560b5930bc817fad9eff87bc61ee75 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 18 Jul 2025 17:39:44 +0200 Subject: [PATCH] Loadpoint: prevent configuring more phases than physically connected (#22438) --- core/loadpoint_api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/loadpoint_api.go b/core/loadpoint_api.go index a45089461..ebd41f32c 100644 --- a/core/loadpoint_api.go +++ b/core/loadpoint_api.go @@ -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)