// In case of multiple instances: add instance index to charging station id
let instanceIndex = process.env.CF_INSTANCE_INDEX ? process.env.CF_INSTANCE_INDEX : 0;
instanceIndex = instanceIndex > 0 ? instanceIndex : '';
-
const idSuffix = stationTemplate.nameSuffix ? stationTemplate.nameSuffix : '';
-
return stationTemplate.fixedName ? stationTemplate.baseName : stationTemplate.baseName + '-' + instanceIndex.toString() + ('000000000' + this.index.toString()).substr(('000000000' + this.index.toString()).length - 4) + idSuffix;
}
if (Utils.convertToInt(lastConnector) === 0 && this._getUseConnectorId0() && this.stationInfo.Connectors[lastConnector]) {
this.connectors[lastConnector] = Utils.cloneObject<Connector>(this.stationInfo.Connectors[lastConnector]);
this.connectors[lastConnector].availability = AvailabilityType.OPERATIVE;
+ if (Utils.isUndefined(this.connectors[lastConnector]?.chargingProfiles)) {
+ this.connectors[lastConnector].chargingProfiles = [];
+ }
}
}
// Generate all connectors
const randConnectorID = this.stationInfo.randomConnectors ? Utils.getRandomInt(Utils.convertToInt(lastConnector), 1) : index;
this.connectors[index] = Utils.cloneObject<Connector>(this.stationInfo.Connectors[randConnectorID]);
this.connectors[index].availability = AvailabilityType.OPERATIVE;
+ if (Utils.isUndefined(this.connectors[lastConnector]?.chargingProfiles)) {
+ this.connectors[index].chargingProfiles = [];
+ }
}
}
}
}
this.stationInfo.powerDivider = this._getPowerDivider();
if (this.getEnableStatistics()) {
- this.statistics = Statistics.getInstance();
- this.statistics.objName = this.stationInfo.chargingStationId;
+ this.statistics = new Statistics(this.stationInfo.chargingStationId);
this.performanceObserver = new PerformanceObserver((list) => {
const entry = list.getEntries()[0];
this.statistics.logPerformance(entry, Constants.ENTITY_CHARGING_STATION);
logger.debug(this._logPrefix() + ' Heartbeat response received: %j to Heartbeat request: %j', payload, requestPayload);
}
+ handleResponseAuthorize(payload: AuthorizeResponse, requestPayload: AuthorizeRequest): void {
+ logger.debug(this._logPrefix() + ' Authorize response received: %j to Authorize request: %j', payload, requestPayload);
+ }
+
async handleRequest(messageId: string, commandName: IncomingRequestCommand, commandPayload: Record<string, unknown>): Promise<void> {
let response;
// Call