X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FMessageChannelUtils.ts;h=19266f73f6fee0348814dd7e4643838c50376a74;hb=5af9aa8a875b3dbd4b4d394ecac022d046fa725c;hp=6e37885b1f8d0e7e7a5ea14e3c3f2955fd220402;hpb=32de5a575189d226213641f5ee36004f8454cb50;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index 6e37885b..19266f73 100644 --- a/src/charging-station/MessageChannelUtils.ts +++ b/src/charging-station/MessageChannelUtils.ts @@ -3,7 +3,7 @@ import { ChargingStationWorkerMessage, ChargingStationWorkerMessageEvents, } from '../types/ChargingStationWorker'; -import Statistics from '../types/Statistics'; +import type Statistics from '../types/Statistics'; import type ChargingStation from './ChargingStation'; export class MessageChannelUtils { @@ -51,9 +51,19 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationData { return { - hashId: chargingStation.hashId, stationInfo: chargingStation.stationInfo, - connectors: Array.from(chargingStation.connectors.values()), + started: chargingStation.started, + wsState: chargingStation?.wsConnection?.readyState, + bootNotificationResponse: chargingStation.bootNotificationResponse, + connectors: [...chargingStation.connectors.values()].map( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + ({ transactionSetInterval, ...connectorStatusRest }) => connectorStatusRest + ), + ...(chargingStation.automaticTransactionGenerator && { + automaticTransactionGeneratorStatuses: [ + ...chargingStation.automaticTransactionGenerator.connectorsStatus.values(), + ], + }), }; } }