X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FMessageChannelUtils.ts;h=f3008b50d117b675cfeec772a8b90518669a998d;hb=3fb26594ef01e3f443bcc0bbf81401c6e38fdc01;hp=2bb43a961ccfa11686896321a52c02b5b0f74eb9;hpb=c8faabc815e314d10188b9c285c61e1e4c367f8c;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/MessageChannelUtils.ts b/src/utils/MessageChannelUtils.ts index 2bb43a96..f3008b50 100644 --- a/src/utils/MessageChannelUtils.ts +++ b/src/utils/MessageChannelUtils.ts @@ -13,37 +13,37 @@ import { } from '../types'; export const buildStartedMessage = ( - chargingStation: ChargingStation + chargingStation: ChargingStation, ): ChargingStationWorkerMessage => { return { - id: ChargingStationWorkerMessageEvents.started, + event: ChargingStationWorkerMessageEvents.started, data: buildChargingStationDataPayload(chargingStation), }; }; export const buildStoppedMessage = ( - chargingStation: ChargingStation + chargingStation: ChargingStation, ): ChargingStationWorkerMessage => { return { - id: ChargingStationWorkerMessageEvents.stopped, + event: ChargingStationWorkerMessageEvents.stopped, data: buildChargingStationDataPayload(chargingStation), }; }; export const buildUpdatedMessage = ( - chargingStation: ChargingStation + chargingStation: ChargingStation, ): ChargingStationWorkerMessage => { return { - id: ChargingStationWorkerMessageEvents.updated, + event: ChargingStationWorkerMessageEvents.updated, data: buildChargingStationDataPayload(chargingStation), }; }; export const buildPerformanceStatisticsMessage = ( - statistics: Statistics + statistics: Statistics, ): ChargingStationWorkerMessage => { return { - id: ChargingStationWorkerMessageEvents.performanceStatistics, + event: ChargingStationWorkerMessageEvents.performanceStatistics, data: statistics, }; }; @@ -54,7 +54,7 @@ const buildChargingStationDataPayload = (chargingStation: ChargingStation): Char stationInfo: chargingStation.stationInfo, connectors: buildConnectorsStatus(chargingStation), evses: buildEvsesStatus(chargingStation, OutputFormat.worker), - ocppConfiguration: chargingStation.ocppConfiguration, + ocppConfiguration: chargingStation.ocppConfiguration!, wsState: chargingStation?.wsConnection?.readyState, bootNotificationResponse: chargingStation.bootNotificationResponse, ...(chargingStation.automaticTransactionGenerator && {