fix: fix firmware update in progress detection
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 5 Jun 2024 17:04:08 +0000 (19:04 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 5 Jun 2024 17:04:08 +0000 (19:04 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

index d92d526e4a062884a55021b0e858767ee267e68e..773d01e318c267fc52b6ec54d61f32b626bbf8a4 100644 (file)
@@ -1304,7 +1304,10 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     commandPayload.retrieveDate = convertToDate(commandPayload.retrieveDate)!
     const { retrieveDate } = commandPayload
-    if (chargingStation.stationInfo?.firmwareStatus !== OCPP16FirmwareStatus.Installed) {
+    if (
+      chargingStation.stationInfo?.firmwareStatus != null &&
+      chargingStation.stationInfo.firmwareStatus !== OCPP16FirmwareStatus.Installed
+    ) {
       logger.warn(
         `${chargingStation.logPrefix()} ${moduleName}.handleRequestUpdateFirmware: Cannot simulate firmware update: firmware update is already in progress`
       )