X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FMessageChannelUtils.ts;h=19266f73f6fee0348814dd7e4643838c50376a74;hb=83e00df1c1ba02de8b637ca4cb0464eb909ebb18;hp=28172461a6895774d6f2c0651849bce039e6754c;hpb=89b7a234c161f2c68b6a9499ff698488e1a35c6b;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index 28172461..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,10 +51,19 @@ export class MessageChannelUtils { chargingStation: ChargingStation ): ChargingStationData { return { - hashId: chargingStation.hashId, stationInfo: chargingStation.stationInfo, - stopped: chargingStation.stopped, - 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(), + ], + }), }; } }