]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor(ocpp2): remove redundant getTxUpdatedInterval wrapper
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 18 Mar 2026 14:24:06 +0000 (15:24 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 18 Mar 2026 14:24:06 +0000 (15:24 +0100)
Call OCPP20ServiceUtils.getTxUpdatedInterval() directly from
OCPP20IncomingRequestService instead of through a trivial private
wrapper that was left over from the centralization in PR #1734.

src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts

index a27832f48521f2e8c7f3871eee1d39804d903359..40375f289716940c117d3854aa47d992039f48c6 100644 (file)
@@ -410,7 +410,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
                 error
               )
             })
-            const txUpdatedInterval = this.getTxUpdatedInterval(chargingStation)
+            const txUpdatedInterval = OCPP20ServiceUtils.getTxUpdatedInterval(chargingStation)
             chargingStation.startTxUpdatedInterval(connectorId, txUpdatedInterval)
           }
         }
@@ -512,7 +512,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
               for (const [cId, connector] of evseStatus.connectors) {
                 if (connector.transactionId == null) continue
                 hasSentTransactionEvent = true
-                const txUpdatedInterval = this.getTxUpdatedInterval(chargingStation)
+                const txUpdatedInterval = OCPP20ServiceUtils.getTxUpdatedInterval(chargingStation)
                 const meterValue = buildMeterValue(
                   chargingStation,
                   cId,
@@ -537,7 +537,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
                   chargingStation,
                   fallbackEvseId > 0 ? fallbackEvseId : 1,
                   0,
-                  this.getTxUpdatedInterval(chargingStation)
+                  OCPP20ServiceUtils.getTxUpdatedInterval(chargingStation)
                 ) as OCPP20MeterValue
               } catch {
                 meterValue = {
@@ -1079,10 +1079,6 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService {
     return state
   }
 
-  private getTxUpdatedInterval (chargingStation: ChargingStation): number {
-    return OCPP20ServiceUtils.getTxUpdatedInterval(chargingStation)
-  }
-
   private handleConnectorChangeAvailability (
     chargingStation: ChargingStation,
     evseId: number,