Skip to content

Commit

Permalink
web/charge_manager: Simplify save/reset checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasTF committed Nov 14, 2024
1 parent 454f042 commit 9625281
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions software/web/src/modules/charge_manager/chargers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ export class ChargeManagerChargers extends ConfigComponent<'charge_manager/confi
}))
return;

let energyManagerMode = API.hasModule("em_common") && !(API.hasModule("evse_v2") || API.hasModule("evse"));
if (!energyManagerMode)
if (API.hasModule("evse_common"))
await API.save_unchecked('evse/management_enabled', {"enabled": this.state.managementEnabled}, translate_unchecked("charge_manager.script.save_failed"));

let new_cfg: ChargeManagerConfig = {...API.get("charge_manager/config"),
Expand Down Expand Up @@ -160,8 +159,7 @@ export class ChargeManagerChargers extends ConfigComponent<'charge_manager/confi
}))
return;

let energyManagerMode = API.hasModule("em_common") && !(API.hasModule("evse_v2") || API.hasModule("evse"));
if (!energyManagerMode)
if (API.hasModule("em_common"))
await API.save_unchecked('evse/management_enabled', {"enabled": false}, translate_unchecked("charge_manager.script.save_failed"));

await super.sendReset(t);
Expand Down

0 comments on commit 9625281

Please sign in to comment.