Updated template migration task with getNumberOfConnectedPhases()
MODIFY
src/migration/tasks/UpdateChargingStationTemplatesTask.ts
src/migration/tasks/UpdateChargingStationTemplatesTask.ts
@@ -69,12 +69,11 @@ export default class UpdateChargingStationTemplatesTask extends MigrationTask {
chargingStationUpdated = true;
}
if (!Utils.objectHasProperty(connector, 'phaseAssignmentToGrid')) {
- if (chargingStation.siteArea?.numberOfPhases === 3) {
- if (connector.numberOfConnectedPhase === 1) {
+ const numberOfPhases = Utils.getNumberOfConnectedPhases(chargingStation, null, connector.connectorId);
+ if (numberOfPhases === 1) {
connector.phaseAssignmentToGrid = { csPhaseL1: OCPPPhase.L1, csPhaseL2: null, csPhaseL3: null } ;
- } else {
+ } else if (numberOfPhases === 3) {
connector.phaseAssignmentToGrid = { csPhaseL1: OCPPPhase.L1, csPhaseL2: OCPPPhase.L2, csPhaseL3: OCPPPhase.L3 } ;
- }
} else {
connector.phaseAssignmentToGrid = null;
}

Updated template migration task with getNumberOfConnectedPhases()