EVSE Data push Fix
MODIFY
src/server/oicp/oicp-services-impl/oicp-2.3.0/OICPMapping.ts
src/server/oicp/oicp-services-impl/oicp-2.3.0/OICPMapping.ts
@@ -73,11 +73,11 @@ export default class OICPMapping {
// It is not possible to flag if connectors of charge points can charge in parallel or not
evses.push(...OICPMapping.convertChargingStation2MultipleEvses(tenant,siteArea, chargingStation, chargePoint, options));
}
- }
} else {
evses.push(...OICPMapping.convertChargingStation2MultipleEvses(tenant, siteArea, chargingStation, null, options));
}
}
+ }
// Return evses
return evses;
}
@@ -306,7 +306,15 @@ export default class OICPMapping {
// Convert charging stations to evse status(es)
for (const chargingStation of siteArea.chargingStations) {
if (chargingStation.issuer && chargingStation.public) {
- evseStatuses.push(...OICPMapping.convertChargingStation2MultipleEvseStatuses(tenant, chargingStation, options));
+ if (!Utils.isEmptyArray(chargingStation.chargePoints)) {
+ for (const chargePoint of chargingStation.chargePoints) {
+ // OICP does not support multiple connectors in one EVSE object
+ // It is not possible to flag if connectors of charge points can charge in parallel or not
+ evseStatuses.push(...OICPMapping.convertChargingStation2MultipleEvseStatuses(tenant, chargingStation, chargePoint, options));
+ }
+ } else {
+ evseStatuses.push(...OICPMapping.convertChargingStation2MultipleEvseStatuses(tenant, chargingStation, null, options));
+ }
}
}
// Return evses
@@ -391,9 +399,14 @@ export default class OICPMapping {
* @param {*} chargingStation
* @return Array of OICP EVSE Statuses
*/
- private static convertChargingStation2MultipleEvseStatuses(tenant: Tenant, chargingStation: ChargingStation, options: { countryID: string; partyID: string; addChargeBoxID?: boolean}): OICPEvseStatusRecord[] {
+ private static convertChargingStation2MultipleEvseStatuses(tenant: Tenant, chargingStation: ChargingStation, chargePoint: ChargePoint, options: { countryID: string; partyID: string; addChargeBoxID?: boolean}): OICPEvseStatusRecord[] {
// Loop through connectors and send one evse per connector
- const connectors = chargingStation.connectors.filter((connector) => connector !== null);
+ let connectors: Connector[];
+ if (chargePoint) {
+ connectors = Utils.getConnectorsFromChargePoint(chargingStation, chargePoint);
+ } else {
+ connectors = chargingStation.connectors.filter((connector) => connector !== null);
+ }
const evseStatuses = connectors.map((connector) => OICPMapping.convertConnector2EvseStatus(tenant, chargingStation, connector, options));
// Return all EVSE Statuses
return evseStatuses;

EVSE Data push Fix