Loadpoint: validate fixed phase configuration (#18234)

This commit is contained in:
andig 2025-01-15 16:45:28 +01:00 • committed by GitHub
parent 285b22ee6e
commit 516993bf50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -623,6 +623,17 @@ func (lp *Loadpoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Even
lp.publish(keys.EnableDelay, lp.Enable.Delay)
lp.publish(keys.DisableDelay, lp.Disable.Delay)
if phases := lp.getChargerPhysicalPhases(); phases != 0 {
if lp.configuredPhases != phases && lp.configuredPhases != 0 {
lp.log.WARN.Printf("configured phases %d do not match physical phases %d", lp.configuredPhases, phases)
}
lp.phases = phases
lp.configuredPhases = phases
lp.publish(keys.ChargerPhysicalPhases, phases)
} else {
lp.publish(keys.ChargerPhysicalPhases, nil)
}
lp.publish(keys.PhasesConfigured, lp.configuredPhases)
lp.publish(keys.ChargerPhases1p3p, lp.hasPhaseSwitching())
lp.publish(keys.PhasesEnabled, lp.phases)
@ -630,12 +641,6 @@ func (lp *Loadpoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Even
lp.publishTimer(phaseTimer, 0, timerInactive)
lp.publishTimer(pvTimer, 0, timerInactive)
if phases := lp.getChargerPhysicalPhases(); phases != 0 {
lp.publish(keys.ChargerPhysicalPhases, phases)
} else {
lp.publish(keys.ChargerPhysicalPhases, nil)
}
// charger features
for _, f := range []api.Feature{api.IntegratedDevice, api.Heating} {
lp.publishChargerFeature(f)