X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FMessageChannelUtils.ts;h=19266f73f6fee0348814dd7e4643838c50376a74;hb=0d8852a590c91d7d24509d6c24defe4e56004f9c;hp=e2a7b0b40db6f3ed246ac3d34e59979bea7eb690;hpb=c76d7c1b81d83af8e9ff498fdcbaefc692e6f134;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index e2a7b0b4..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,11 +51,19 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationData { return { - hashId: chargingStation.hashId, stationInfo: chargingStation.stationInfo, - stopped: chargingStation.stopped, + started: chargingStation.started, + wsState: chargingStation?.wsConnection?.readyState, bootNotificationResponse: chargingStation.bootNotificationResponse, - connectors: Array.from(chargingStation.connectors.values()), + connectors: [...chargingStation.connectors.values()].map( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + ({ transactionSetInterval, ...connectorStatusRest }) => connectorStatusRest + ), + ...(chargingStation.automaticTransactionGenerator && { + automaticTransactionGeneratorStatuses: [ + ...chargingStation.automaticTransactionGenerator.connectorsStatus.values(), + ], + }), }; } }