UI services: fix connectors status update at transaction start/stop
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Sep 2022 20:15:57 +0000 (22:15 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Sep 2022 20:15:57 +0000 (22:15 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ChargingStationWorkerBroadcastChannel.ts

index a42135766f3b8b4f66d5c375cb6d773659784b37..7d633eb07b97940002922cbefae236dad8e3e39a 100644 (file)
@@ -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) {
index 21b83b9f3f92894c6e3f3b4c5fbea169d39e0b6c..0c3af5887ee06b494269b426df6736df25374a37 100644 (file)
@@ -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);