public getAutomaticTransactionGeneratorConfiguration():
| AutomaticTransactionGeneratorConfiguration
| undefined {
+ let automaticTransactionGeneratorConfiguration:
+ | AutomaticTransactionGeneratorConfiguration
+ | undefined;
const automaticTransactionGeneratorConfigurationFromFile =
this.getConfigurationFromFile()?.automaticTransactionGenerator;
if (automaticTransactionGeneratorConfigurationFromFile) {
- return automaticTransactionGeneratorConfigurationFromFile;
+ automaticTransactionGeneratorConfiguration =
+ automaticTransactionGeneratorConfigurationFromFile;
+ } else {
+ automaticTransactionGeneratorConfiguration =
+ this.getTemplateFromFile()?.AutomaticTransactionGenerator;
}
- return this.getTemplateFromFile()?.AutomaticTransactionGenerator;
+ return {
+ ...Constants.DEFAULT_ATG_CONFIGURATION,
+ ...automaticTransactionGeneratorConfiguration,
+ };
}
public startAutomaticTransactionGenerator(connectorIds?: number[]): void {
private getStationInfoFromTemplate(): ChargingStationInfo {
const stationTemplate: ChargingStationTemplate | undefined = this.getTemplateFromFile();
- ChargingStationUtils.checkTemplateFile(stationTemplate, this.logPrefix(), this.templateFile);
+ ChargingStationUtils.checkTemplate(stationTemplate, this.logPrefix(), this.templateFile);
ChargingStationUtils.warnTemplateKeysDeprecation(
stationTemplate,
this.logPrefix(),
private initialize(): void {
const stationTemplate = this.getTemplateFromFile();
- ChargingStationUtils.checkTemplateFile(stationTemplate, this.logPrefix(), this.templateFile);
+ ChargingStationUtils.checkTemplate(stationTemplate, this.logPrefix(), this.templateFile);
this.configurationFile = path.join(
path.dirname(this.templateFile.replace('station-templates', 'configurations')),
`${ChargingStationUtils.getHashId(this.index, stationTemplate)}.json`
skipBufferingOnError: true,
});
if (this.isRegistered() === false) {
- this.getRegistrationMaxRetries() !== -1 && registrationRetryCount++;
+ this.getRegistrationMaxRetries() !== -1 && ++registrationRetryCount;
await Utils.sleep(
this?.bootNotificationResponse?.interval
? this.bootNotificationResponse.interval * 1000
if (Utils.isNotEmptyString(configuredSupervisionUrl)) {
return new URL(configuredSupervisionUrl);
}
- const errorMsg = 'No supervision url configured';
+ const errorMsg = 'No supervision url(s) configured';
logger.error(`${this.logPrefix()} ${errorMsg}`);
throw new BaseError(`${errorMsg}`);
}
this.autoReconnectRetryCount < this.getAutoReconnectMaxRetries() ||
this.getAutoReconnectMaxRetries() === -1
) {
- this.autoReconnectRetryCount++;
+ ++this.autoReconnectRetryCount;
const reconnectDelay = this.getReconnectExponentialDelay()
? Utils.exponentialDelay(this.autoReconnectRetryCount)
: this.getConnectionTimeout() * 1000;