}
}
- public getFirmwareUpgrade(): FirmwareUpgrade {
- return merge(
- {
- reset: true,
- },
- this.stationInfo.firmwareUpgrade
- );
- }
-
public async reset(reason?: StopTransactionReason): Promise<void> {
await this.stop(reason);
await Utils.sleep(this.stationInfo.resetTime);
} does not match firmware version pattern '${stationInfo.firmwareVersionPattern}'`
);
}
+ stationInfo.firmwareUpgrade = merge(
+ {
+ reset: true,
+ },
+ stationTemplate.firmwareUpgrade ?? {}
+ );
stationInfo.resetTime = stationTemplate.resetTime
? stationTemplate.resetTime * 1000
: Constants.CHARGING_STATION_DEFAULT_RESET_TIME;
this.stationInfo.firmwareVersion &&
this.stationInfo.firmwareVersionPattern
) {
- const versionStep = this.getFirmwareUpgrade()?.versionUpgrade?.step ?? 1;
+ const versionStep = this.stationInfo.firmwareUpgrade?.versionUpgrade?.step ?? 1;
const patternGroup: number =
- this.getFirmwareUpgrade()?.versionUpgrade?.patternGroup ??
+ this.stationInfo.firmwareUpgrade?.versionUpgrade?.patternGroup ??
this.stationInfo.firmwareVersion.split('.').length;
const match = this.stationInfo.firmwareVersion
.match(new RegExp(this.stationInfo.firmwareVersionPattern))
}
}
if (
- chargingStation.getFirmwareUpgrade()?.failureStatus &&
- !Utils.isEmptyString(chargingStation.getFirmwareUpgrade().failureStatus)
+ chargingStation.stationInfo?.firmwareUpgrade?.failureStatus &&
+ !Utils.isEmptyString(chargingStation.stationInfo?.firmwareUpgrade?.failureStatus)
) {
await chargingStation.ocppRequestService.requestHandler<
OCPP16FirmwareStatusNotificationRequest,
OCPP16FirmwareStatusNotificationResponse
>(chargingStation, OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION, {
- status: chargingStation.getFirmwareUpgrade().failureStatus,
+ status: chargingStation.stationInfo?.firmwareUpgrade?.failureStatus,
});
return;
}
status: OCPP16FirmwareStatus.Installing,
});
chargingStation.stationInfo.firmwareStatus = OCPP16FirmwareStatus.Installing;
- if (chargingStation.getFirmwareUpgrade().reset === true) {
+ if (chargingStation.stationInfo?.firmwareUpgrade?.reset === true) {
await Utils.sleep(Utils.getRandomInteger(maxDelay, minDelay) * 1000);
await chargingStation.reset(OCPP16StopTransactionReason.REBOOT);
}