From 4f317101dedf3e41deaa06cc04ef5beaf79af3bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 3 Sep 2022 22:15:57 +0200 Subject: [PATCH] UI services: fix connectors status update at transaction start/stop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 1 + src/charging-station/ChargingStationWorkerBroadcastChannel.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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); -- 2.34.1