From 8d8599f0565ba2121394a3d22214d13dbfa0f2c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 20 Feb 2023 19:56:10 +0100 Subject: [PATCH] feat(simulator): expose OCPP configuration in UI protocol MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/MessageChannelUtils.ts | 7 ++++--- src/types/ChargingStationWorker.ts | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/charging-station/MessageChannelUtils.ts b/src/charging-station/MessageChannelUtils.ts index 749a21dd..1bc26d62 100644 --- a/src/charging-station/MessageChannelUtils.ts +++ b/src/charging-station/MessageChannelUtils.ts @@ -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: diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index d2881c0a..d53152dc 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -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; } -- 2.34.1