From 6eba8caeedbff34f42c62aa286e61368c0955205 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 18 Mar 2026 15:24:06 +0100 Subject: [PATCH] refactor(ocpp2): remove redundant getTxUpdatedInterval wrapper Call OCPP20ServiceUtils.getTxUpdatedInterval() directly from OCPP20IncomingRequestService instead of through a trivial private wrapper that was left over from the centralization in PR #1734. --- .../ocpp/2.0/OCPP20IncomingRequestService.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts index a27832f4..40375f28 100644 --- a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts @@ -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, -- 2.43.0