Skip to content

Commit

Permalink
web/power_manager: More universal phase switching capability check
Browse files Browse the repository at this point in the history
This will also work if both em_common and evse are present.
  • Loading branch information
MattiasTF committed Oct 23, 2024
1 parent b51ec0c commit 2c1127c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions software/web/src/modules/power_manager/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,8 @@ export class PVExcessSettings extends ConfigComponent<'power_manager/config', {s
// On a charger, the power manager is enabled iff excess charging is enabled.
let enabled = is_em ? s.enabled : s.excess_charging_enable;

let can_switch_phases = false;
if (is_em) {
can_switch_phases = API.get_unchecked('energy_manager/config')?.contactor_installed;
} else if (API.hasFeature("evse")) {
can_switch_phases = API.get_unchecked('evse/hardware_configuration')?.evse_version >= 30;
}
let can_switch_phases = is_em && API.get_unchecked('energy_manager/config')?.contactor_installed
|| API.hasFeature("evse") && API.get_unchecked('evse/hardware_configuration')?.evse_version >= 30;

let debug_mode = API.hasModule("debug");

Expand Down

0 comments on commit 2c1127c

Please sign in to comment.