Apply dependencies update
[e-mobility-charging-stations-simulator.git] / src / charging-station / MessageChannelUtils.ts
index 4cf037ba28e890dbb82eeae840dcc42bf221dbb5..fe11041afd2dd30fdef81fa6fa8aec427148c1be 100644 (file)
@@ -3,7 +3,7 @@ import {
   ChargingStationWorkerMessage,
   ChargingStationWorkerMessageEvents,
 } from '../types/ChargingStationWorker';
-import type Statistics from '../types/Statistics';
+import type { Statistics } from '../types/Statistics';
 import type ChargingStation from './ChargingStation';
 
 export class MessageChannelUtils {
@@ -51,13 +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()).map(
+      connectors: [...chargingStation.connectors.values()].map(
+        // eslint-disable-next-line @typescript-eslint/no-unused-vars
         ({ transactionSetInterval, ...connectorStatusRest }) => connectorStatusRest
       ),
+      ...(chargingStation.automaticTransactionGenerator && {
+        automaticTransactionGeneratorStatuses: [
+          ...chargingStation.automaticTransactionGenerator.connectorsStatus.values(),
+        ],
+      }),
     };
   }
 }