]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix: resolve #1244 — add per-connector maximum power support (#1843)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sat, 9 May 2026 17:15:55 +0000 (19:15 +0200)
committerGitHub <noreply@github.com>
Sat, 9 May 2026 17:15:55 +0000 (19:15 +0200)
commitc9994a3576f300bffd6efce3a5c216a58010bb92
treeb31c2a30406bd7a98c396b61f2edbecb62736727
parent94bed6d3cdcaa7603f3e9b833b6c87e337c3dc80
fix: resolve #1244 — add per-connector maximum power support (#1843)

* feat(charging-station): add per-connector maximum power support

Add maximumPower field to ConnectorStatus representing the physical
limitation of each connector cable/plug (thermal current rating).

Per OCPP Device Model, AvailablePowerMaxLimit is defined at the
Connector component level. The connector maximumPower acts as a
hardware cap in the power computation pipeline alongside the station-
level powerDivider sharing mechanism.

- Add ConnectorStatus.maximumPower?: number (in W)
- Initialize at boot via initializeConnectorsMaximumPower(): default
  is stationPower / staticConnectorCount (using static count, not
  dynamic powerDivider which can be 0 in shared mode at init)
- Clamp in getConnectorMaximumAvailablePower as additional min() term
- Use in getConnectorChargingProfilesLimit as primary cap (falls back
  to stationPower/powerDivider for backward compat)
- Update 6 shared-mode templates with explicit maximumPower per
  connector (= station power for DC shared-bus stations)

Resolves #1244

* chore(sandcastle): update validation and main scripts

* chore: sync release-please manifests and sandcastle prompt

* fix(charging-station): exclude index 0 from staticCount in getDefaultConnectorMaximumPower

The staticCount calculation included EVSE 0 and connector 0, while runtime
getPowerDivider excludes them. This caused connector hardware caps to be
more restrictive than intended (e.g., stationPower/3 instead of
stationPower/2 on a 2-EVSE station with EVSE 0 defined).

* [autofix.ci] apply automated fixes

* refactor(charging-station): add NaN guard to connectorHardwareMaximumPower in min()

Align the connectorHardwareMaximumPower entry with the same null/NaN guard
pattern used by all other entries in the min() call for consistency and
defensive robustness.

* docs: document per-connector maximumPower in template examples

Add maximumPower field to Connectors and Evses section examples.
Clarify powerSharedByConnectors behavior description.

---------

Co-authored-by: Jérôme Benoit <jerome.benoit@sap.com>
Co-authored-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
14 files changed:
.sandcastle/main.ts
.sandcastle/plan-prompt.md
.sandcastle/strategies/implement/critic-prompt.md
.sandcastle/validation.ts
README.md
src/assets/station-templates/abb-atg.station-template.json
src/assets/station-templates/abb.station-template.json
src/assets/station-templates/virtual-simple-atg.station-template.json
src/assets/station-templates/virtual-simple-signed.station-template.json
src/assets/station-templates/virtual-simple.station-template.json
src/assets/station-templates/virtual.station-template.json
src/charging-station/ChargingStation.ts
src/charging-station/Helpers.ts
src/types/ConnectorStatus.ts