feat: add template tunable to stop transaction at CS stop
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 10 Nov 2023 18:23:47 +0000 (19:23 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 10 Nov 2023 18:23:47 +0000 (19:23 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
README.md
src/charging-station/ChargingStation.ts
src/types/ChargingStationTemplate.ts

index e6c1d9de6e02ac81dbba3ed502f6b974e1feff4a..5c800ed234ef740681e906fa42cf3e4a73ebf96a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -171,6 +171,7 @@ But the modifications to test have to be done to the files in the build target d
 | outOfOrderEndMeterValues                             | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | send Transaction.End MeterValues out of order. Need to relax OCPP specifications strict compliance ('ocppStrictCompliance' parameter)                                                                                                      |
 | meteringPerTransaction                               | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable metering history on a per transaction basis                                                                                                                                                                                         |
 | transactionDataMeterValues                           | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | enable transaction data MeterValues at stop transaction                                                                                                                                                                                    |
+| stopTransactionsOnStopped                            | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable stop transactions on charging station stop                                                                                                                                                                                          |
 | mainVoltageMeterValues                               | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | include charging stations main voltage MeterValues on three phased charging stations                                                                                                                                                       |
 | phaseLineToLineVoltageMeterValues                    | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | include charging stations line to line voltage MeterValues on three phased charging stations                                                                                                                                               |
 | customValueLimitationMeterValues                     | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable limitation on custom fluctuated value in MeterValues                                                                                                                                                                                |
index e7b71b0521da42570a7b9d8d9d0c351bfbee747b..033152d6bf0d62c760f4477f3324351198c4f31b 100644 (file)
@@ -2183,7 +2183,7 @@ export class ChargingStation extends EventEmitter {
 
   private async stopMessageSequence(
     reason?: StopTransactionReason,
-    stopTransactions = true,
+    stopTransactions = this.stationInfo?.stopTransactionsOnStopped ?? true,
   ): Promise<void> {
     // Stop WebSocket ping
     this.stopWebSocketPing();
index 68c20597c4edf2cbf8f5db99fe61ab6e3d970ea2..5fd77851b9493b0cdbd5e28066e4b8b0f15b5493 100644 (file)
@@ -119,6 +119,7 @@ export interface ChargingStationTemplate {
   outOfOrderEndMeterValues?: boolean;
   meteringPerTransaction?: boolean;
   transactionDataMeterValues?: boolean;
+  stopTransactionsOnStopped?: boolean;
   mainVoltageMeterValues?: boolean;
   phaseLineToLineVoltageMeterValues?: boolean;
   customValueLimitationMeterValues?: boolean;