fix: ensure all charging station changes are pushed at start transaction
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 31 Jul 2023 21:08:21 +0000 (23:08 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 31 Jul 2023 21:08:21 +0000 (23:08 +0200)
error

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts

index a2cfc53142900ad9cd12d32ed6cb1c8ec4a14f54..a1fa0e43aa535ecbae64596431dbe058ef93966a 100644 (file)
@@ -728,7 +728,6 @@ export class OCPP16ResponseService extends OCPPResponseService {
   ): Promise<void> {
     resetConnectorStatus(chargingStation.getConnectorStatus(connectorId)!);
     chargingStation.stopMeterValues(connectorId);
-    parentPort?.postMessage(buildUpdatedMessage(chargingStation));
     if (
       chargingStation.getConnectorStatus(connectorId)?.status !== OCPP16ChargePointStatus.Available
     ) {
@@ -738,6 +737,7 @@ export class OCPP16ResponseService extends OCPPResponseService {
         OCPP16ChargePointStatus.Available,
       );
     }
+    parentPort?.postMessage(buildUpdatedMessage(chargingStation));
   }
 
   private async handleResponseStopTransaction(