feat(simulator): expose OCPP configuration in UI protocol
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 20 Feb 2023 18:56:10 +0000 (19:56 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 20 Feb 2023 18:56:10 +0000 (19:56 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/MessageChannelUtils.ts
src/types/ChargingStationWorker.ts

index 749a21ddcac8b767f2732868f3cfdd154dd53444..1bc26d622289bf63454e809836b3f45f00bce834 100644 (file)
@@ -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:
index d2881c0aa1f126fa955fc45f55c39d15fdffe8b3..d53152dc00dd4c2cf56f0d23064d35548468d9cc 100644 (file)
@@ -4,6 +4,7 @@ import type {
   BootNotificationResponse,
   ChargingStationAutomaticTransactionGeneratorConfiguration,
   ChargingStationInfo,
+  ChargingStationOcppConfiguration,
   ConnectorStatus,
   JsonObject,
   Statistics,
@@ -21,15 +22,16 @@ export interface ChargingStationWorkerData extends WorkerData {
 }
 
 export interface ChargingStationData extends WorkerData {
-  stationInfo: ChargingStationInfo;
   started: boolean;
+  stationInfo: ChargingStationInfo;
+  connectors: ConnectorStatus[];
+  ocppConfiguration: ChargingStationOcppConfiguration;
   wsState?:
     | typeof WebSocket.CONNECTING
     | typeof WebSocket.OPEN
     | typeof WebSocket.CLOSING
     | typeof WebSocket.CLOSED;
   bootNotificationResponse?: BootNotificationResponse;
-  connectors: ConnectorStatus[];
   automaticTransactionGenerator?: ChargingStationAutomaticTransactionGeneratorConfiguration;
 }