X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorkerBroadcastChannel.ts;h=64332533d4dfc606f9b551e5f3f0de8aa85c66ab;hb=51c83d6f833f27f9990c17fc380ab5ee618894b1;hp=6fc700d29c8d2f322fffffd32150e592a2e02898;hpb=c36e6303452271ac08ff6f5db532e7f13f5b4779;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 6fc700d2..64332533 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -44,13 +44,14 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca if ( requestPayload?.hashId === undefined && - (requestPayload?.hashIds as string[])?.includes(this.chargingStation.hashId) === false + (requestPayload?.hashIds as string[])?.includes(this.chargingStation.stationInfo.hashId) === + false ) { return; } if ( requestPayload?.hashIds === undefined && - requestPayload?.hashId !== this.chargingStation.hashId + requestPayload?.hashId !== this.chargingStation.stationInfo.hashId ) { return; } @@ -66,12 +67,12 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca commandResponse = await this.commandHandler(command, requestPayload); if (commandResponse === undefined) { responsePayload = { - hashId: this.chargingStation.hashId, + hashId: this.chargingStation.stationInfo.hashId, status: ResponseStatus.SUCCESS, }; } else { responsePayload = { - hashId: this.chargingStation.hashId, + hashId: this.chargingStation.stationInfo.hashId, status: this.commandResponseToResponseStatus(commandResponse), }; } @@ -81,7 +82,7 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca error ); responsePayload = { - hashId: this.chargingStation.hashId, + hashId: this.chargingStation.stationInfo.hashId, status: ResponseStatus.FAILURE, command, requestPayload,