X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.ts;h=4f65a4e6a0c28122cf37e877daf7b4d953973670;hb=517ffa58b673e8ece31c6520d0f2331848fc05ed;hp=43fb6889fa65cfb48df6d44d599f328398d084ad;hpb=d21c49d6524dd8c4cb29da3d0925a5994ac6feb1;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 43fb6889..4f65a4e6 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -854,27 +854,6 @@ export class ChargingStation { return template; } - private warnTemplateKeysDeprecation(stationTemplate: ChargingStationTemplate) { - const templateKeys: { key: string; deprecatedKey: string }[] = [ - { key: 'supervisionUrls', deprecatedKey: 'supervisionUrl' }, - { key: 'idTagsFile', deprecatedKey: 'authorizationFile' }, - ]; - for (const templateKey of templateKeys) { - ChargingStationUtils.warnDeprecatedTemplateKey( - stationTemplate, - templateKey.deprecatedKey, - this.templateFile, - this.logPrefix(), - `Use '${templateKey.key}' instead` - ); - ChargingStationUtils.convertDeprecatedTemplateKey( - stationTemplate, - templateKey.deprecatedKey, - templateKey.key - ); - } - } - private getStationInfoFromTemplate(): ChargingStationInfo { const stationTemplate: ChargingStationTemplate | undefined = this.getTemplateFromFile(); if (Utils.isNullOrUndefined(stationTemplate)) { @@ -887,7 +866,11 @@ export class ChargingStation { logger.error(`${this.logPrefix()} ${errorMsg}`); throw new BaseError(errorMsg); } - this.warnTemplateKeysDeprecation(stationTemplate); + ChargingStationUtils.warnTemplateKeysDeprecation( + this.templateFile, + stationTemplate, + this.logPrefix() + ); const stationInfo: ChargingStationInfo = ChargingStationUtils.stationTemplateToStationInfo(stationTemplate); stationInfo.hashId = ChargingStationUtils.getHashId(this.index, stationTemplate); @@ -1337,8 +1320,7 @@ export class ChargingStation { } if ( connectorId > 0 && - (this.getConnectorStatus(connectorId)?.transactionStarted === undefined || - this.getConnectorStatus(connectorId)?.transactionStarted === null) + Utils.isNullOrUndefined(this.getConnectorStatus(connectorId)?.transactionStarted) ) { this.initializeConnectorStatus(connectorId); }