From: Jérôme Benoit Date: Sat, 3 Sep 2022 20:15:57 +0000 (+0200) Subject: UI services: fix connectors status update at transaction start/stop X-Git-Tag: v1.1.70~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4f317101dedf3e41deaa06cc04ef5beaf79af3bd;p=e-mobility-charging-stations-simulator.git UI services: fix connectors status update at transaction start/stop Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index a4213576..7d633eb0 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -652,6 +652,7 @@ export default class ChargingStation { this.getConnectorStatus(connectorId).transactionEnergyActiveImportRegisterValue = 0; delete this.getConnectorStatus(connectorId).transactionBeginMeterValue; this.stopMeterValues(connectorId); + parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(this)); } public hasFeatureProfile(featureProfile: SupportedFeatureProfiles) { diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 21b83b9f..0c3af588 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -137,7 +137,7 @@ export default class ChargingStationWorkerBroadcastChannel extends WorkerBroadca true ), idTag: this.chargingStation.getTransactionIdTag(requestPayload.transactionId), - reason: requestPayload.reason ?? StopTransactionReason.NONE, + ...(requestPayload.reason && { reason: requestPayload.reason }), }); case BroadcastChannelProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR: this.chargingStation.startAutomaticTransactionGenerator(requestPayload.connectorIds);