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)) {
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);
}
if (
connectorId > 0 &&
- (this.getConnectorStatus(connectorId)?.transactionStarted === undefined ||
- this.getConnectorStatus(connectorId)?.transactionStarted === null)
+ Utils.isNullOrUndefined(this.getConnectorStatus(connectorId)?.transactionStarted)
) {
this.initializeConnectorStatus(connectorId);
}