X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FMessageChannelUtils.ts;h=446ecfbbdef0b0ee2371e57b8a0668459e165024;hb=63a402d3bbdc7ab6e997ed6eab164e9ff4af371a;hp=d8f1aa105a926b4fc0cf3b2025c9b58f121a3bf4;hpb=268a74bb051fcbbad532fd833f0d8fd2b33b6c64;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index d8f1aa10..446ecfbb 100644 --- a/src/charging-station/MessageChannelUtils.ts +++ b/src/charging-station/MessageChannelUtils.ts @@ -1,4 +1,4 @@ -import type { ChargingStation } from './ChargingStation'; +import type { ChargingStation } from './internal'; import { type ChargingStationData, type ChargingStationWorkerMessage, @@ -15,7 +15,7 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationWorkerMessage { return { - id: ChargingStationWorkerMessageEvents.STARTED, + id: ChargingStationWorkerMessageEvents.started, data: MessageChannelUtils.buildChargingStationDataPayload(chargingStation), }; } @@ -24,7 +24,7 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationWorkerMessage { return { - id: ChargingStationWorkerMessageEvents.STOPPED, + id: ChargingStationWorkerMessageEvents.stopped, data: MessageChannelUtils.buildChargingStationDataPayload(chargingStation), }; } @@ -33,7 +33,7 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationWorkerMessage { return { - id: ChargingStationWorkerMessageEvents.UPDATED, + id: ChargingStationWorkerMessageEvents.updated, data: MessageChannelUtils.buildChargingStationDataPayload(chargingStation), }; } @@ -42,7 +42,7 @@ export class MessageChannelUtils { statistics: Statistics ): ChargingStationWorkerMessage { return { - id: ChargingStationWorkerMessageEvents.PERFORMANCE_STATISTICS, + id: ChargingStationWorkerMessageEvents.performanceStatistics, data: statistics, }; } @@ -51,14 +51,15 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationData { return { - stationInfo: chargingStation.stationInfo, started: chargingStation.started, - wsState: chargingStation?.wsConnection?.readyState, - bootNotificationResponse: chargingStation.bootNotificationResponse, + stationInfo: chargingStation.stationInfo, connectors: [...chargingStation.connectors.values()].map( // eslint-disable-next-line @typescript-eslint/no-unused-vars ({ transactionSetInterval, ...connectorStatusRest }) => connectorStatusRest ), + ocppConfiguration: chargingStation.ocppConfiguration, + wsState: chargingStation?.wsConnection?.readyState, + bootNotificationResponse: chargingStation.bootNotificationResponse, ...(chargingStation.automaticTransactionGenerator && { automaticTransactionGenerator: { automaticTransactionGenerator: