From: Jérôme Benoit Date: Mon, 20 Feb 2023 18:56:10 +0000 (+0100) Subject: feat(simulator): expose OCPP configuration in UI protocol X-Git-Tag: v1.1.95~39 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8d8599f0565ba2121394a3d22214d13dbfa0f2c3;p=e-mobility-charging-stations-simulator.git feat(simulator): expose OCPP configuration in UI protocol Signed-off-by: Jérôme Benoit --- 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; }