Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix phase configuration #18121

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/js/components/Loadpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export default {
phases: Number,
phasesConfigured: Number,
phasesActive: Number,
chargerPhases1p3p: Boolean,
chargerPhysicalPhases: Number,
chargerPhaseSwitching: Boolean,
chargerPhaseReading: Boolean,
minCurrent: Number,
maxCurrent: Number,
chargeCurrent: Number,
Expand Down
20 changes: 10 additions & 10 deletions assets/js/components/LoadpointSettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{{ $t("main.loadpointSettings.phasesConfigured.label") }}
</label>
<div class="col-sm-8 pe-0">
<p v-if="!chargerPhases1p3p" class="mt-0 mb-2">
<p v-if="!chargerPhaseSwitching" class="mt-0 mb-2">
<small>
{{
$t(
Expand Down Expand Up @@ -184,8 +184,8 @@ export default {
id: [String, Number],
phasesConfigured: Number,
phasesActive: Number,
chargerPhases1p3p: Boolean,
chargerPhysicalPhases: Number,
chargerPhaseSwitching: Boolean,
chargerPhaseReading: Boolean,
batteryBoost: Boolean,
batteryBoostAvailable: Boolean,
mode: String,
Expand Down Expand Up @@ -215,22 +215,22 @@ export default {
},
computed: {
phasesOptions() {
if (this.chargerPhysicalPhases == 1) {
// known fixed phase configuration, no settings required
return [];
}
if (this.chargerPhases1p3p) {
if (this.chargerPhaseSwitching) {
// automatic switching
return [PHASES_AUTO, PHASES_3, PHASES_1];
}
if (this.chargerPhaseReading) {
// known fixed phase configuration, no settings required
return [];
}
// 1p or 3p possible
return [PHASES_3, PHASES_1];
},
batteryBoostProps() {
return this.collectProps(LoadpointSettingsBatteryBoost);
},
maxPower() {
if (this.chargerPhases1p3p) {
if (this.chargerPhaseSwitching) {
if (this.phasesConfigured === PHASES_AUTO) {
return this.maxPowerPhases(3);
}
Expand All @@ -241,7 +241,7 @@ export default {
return this.fmtW(this.maxCurrent * V * this.phasesActive);
},
minPower() {
if (this.chargerPhases1p3p) {
if (this.chargerPhaseSwitching) {
if (this.phasesConfigured === PHASES_AUTO) {
return this.minPowerPhases(1);
}
Expand Down
4 changes: 2 additions & 2 deletions core/keys/loadpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const (

ChargerIcon = "chargerIcon" // charger icon for ui
ChargerFeature = "chargerFeature" // charger feature
ChargerPhysicalPhases = "chargerPhysicalPhases" // charger phases
ChargerPhases1p3p = "chargerPhases1p3p" // phase switcher (1p3p chargers)
ChargerPhaseSwitching = "chargerPhaseSwitching" // api.PhaseSwitcher: phase switcher (1p3p chargers) available
ChargerPhaseReading = "chargerPhaseReading" // api.PhaseDescriber: get charger phases available
ChargerStatusReason = "chargerStatusReason" // either awaiting authorization or disconnect required

// loadpoint status
Expand Down
9 changes: 2 additions & 7 deletions core/loadpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,18 +624,13 @@ func (lp *Loadpoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Even
lp.publish(keys.DisableDelay, lp.Disable.Delay)

lp.publish(keys.PhasesConfigured, lp.configuredPhases)
lp.publish(keys.ChargerPhases1p3p, lp.hasPhaseSwitching())
lp.publish(keys.ChargerPhaseSwitching, lp.hasPhaseSwitching())
lp.publish(keys.ChargerPhaseReading, lp.getChargerPhysicalPhases() != 0)
lp.publish(keys.PhasesEnabled, lp.phases)
lp.publish(keys.PhasesActive, lp.ActivePhases())
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)
Expand Down
Loading