X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcharging-station%2FChargingStationWorkerBroadcastChannel.ts;h=a67b9423649b1e0f97003bcf909bc67ff6b6e319;hb=5e8e29f4f47246cdc49449aa6ca472c64393f7e8;hp=154e1afb14bbb8631fdb570c3a95c2888e4516f2;hpb=1984f1944eeb7468c2f3adbf03b83fbc98910dff;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 154e1afb..a67b9423 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -146,7 +146,6 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca ); return; } - let responsePayload: BroadcastChannelResponsePayload; let commandResponse: CommandResponse | void; try { @@ -157,19 +156,19 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca status: ResponseStatus.SUCCESS, }; } else { - const responseStatus = this.commandResponseToResponseStatus( + const commandResponseStatus = this.commandResponseToResponseStatus( command, commandResponse as CommandResponse ); - if (responseStatus === ResponseStatus.SUCCESS) { + if (commandResponseStatus === ResponseStatus.SUCCESS) { responsePayload = { hashId: this.chargingStation.stationInfo.hashId, - status: responseStatus, + status: commandResponseStatus, }; } else { responsePayload = { hashId: this.chargingStation.stationInfo.hashId, - status: responseStatus, + status: commandResponseStatus, command, requestPayload, commandResponse: commandResponse as CommandResponse,