assign to dc stations too (agreed with jerome)
MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -1198,8 +1198,8 @@ export default class OCPPUtils {
}
if (chargingStation.siteAreaID && !connector.phaseAssignmentToGrid) {
const siteArea = await SiteAreaStorage.getSiteArea(tenantID, chargingStation.siteAreaID);
- if (siteArea.numberOfPhases === 3 && Utils.getChargingStationCurrentType(chargingStation, null) === CurrentType.AC) {
- const numberOfPhases = Utils.getNumberOfConnectedPhases(chargingStation);
+ if (siteArea.numberOfPhases === 3) {
+ const numberOfPhases = Utils.getNumberOfConnectedPhases(chargingStation, null, connectorID);
switch (numberOfPhases) {
case 3:
connector.phaseAssignmentToGrid = { csPhaseL1: OCPPPhase.L1, csPhaseL2: OCPPPhase.L2, csPhaseL3: OCPPPhase.L3 } ;

MODIFY
test/api/context/TenantContext.ts
test/api/context/TenantContext.ts
@@ -476,16 +476,28 @@ export default class TenantContext {
// `Connector ID 1 of charging station ${createdChargingStation.id} must have 654 A`);
expect(createdChargingStation.connectors[0].type).to.eql('CCS',
`Connector ID 1 of charging station ${createdChargingStation.id} must have CCS connector`);
- expect(createdChargingStation.connectors[0].phaseAssignmentToGrid).to.eql(null,
- `Connector ID 1 of charging station ${createdChargingStation.id} must not have phase assignment to grid`);
+ if (siteArea) {
+ expect(createdChargingStation.connectors[0].phaseAssignmentToGrid).to.eql({
+ 'csPhaseL1': 'L1',
+ 'csPhaseL2': 'L2',
+ 'csPhaseL3': 'L3',
+ },
+ `Connector ID 1 of charging station ${createdChargingStation.id} must have default phase assignment`);
+ }
expect(createdChargingStation.connectors[1].power).to.eql(150000,
`Connector ID 2 of charging station ${createdChargingStation.id} must have 150000 W`);
// Expect(createdChargingStation.connectors[1].amperage).to.eql(654,
// `Connector ID 2 of charging station ${createdChargingStation.id} must have 654 A`);
expect(createdChargingStation.connectors[1].type).to.eql('CCS',
`Connector ID 2 of charging station ${createdChargingStation.id} must have CCS connector`);
- expect(createdChargingStation.connectors[1].phaseAssignmentToGrid).to.eql(null,
- `Connector ID 2 of charging station ${createdChargingStation.id} must not have phase assignment to grid`);
+ if (siteArea) {
+ expect(createdChargingStation.connectors[1].phaseAssignmentToGrid).to.eql({
+ 'csPhaseL1': 'L1',
+ 'csPhaseL2': 'L2',
+ 'csPhaseL3': 'L3',
+ },
+ `Connector ID 2 of charging station ${createdChargingStation.id} must have default phase assignment`);
+ }
// Charge Points
expect(createdChargingStation.chargePoints.length).to.eql(1,
`Number of charge point of charging station ${createdChargingStation.id} must be 1`);

assign to dc stations too (agreed with jerome)