Loadpoint: validate fixed phase configuration (#18234)
This commit is contained in:
parent
285b22ee6e
commit
516993bf50
1 changed files with 11 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue