From: Jérôme Benoit Date: Sat, 28 Mar 2026 12:29:21 +0000 (+0100) Subject: refactor: move debug param to last position in buildMeterValue X-Git-Tag: ocpp-server@v4.0.0~13 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7cd25ce497c07c35706d96c88b59217dae36c79a;p=e-mobility-charging-stations-simulator.git refactor: move debug param to last position in buildMeterValue Reorder buildMeterValue signature so debug is the last optional parameter, consistent with all other validate*MeasurandValue functions. Removes need to pass explicit false to reach measurandsKey and context. --- diff --git a/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts b/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts index d15b038d..4c6775fa 100644 --- a/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts +++ b/src/charging-station/ocpp/2.0/OCPP20ServiceUtils.ts @@ -112,7 +112,6 @@ export class OCPP20ServiceUtils extends OCPPServiceUtils { chargingStation, transactionId, 0, - false, measurandsKey, OCPP20ReadingContextEnumType.TRANSACTION_BEGIN ) as OCPP20MeterValue @@ -752,7 +751,6 @@ export class OCPP20ServiceUtils extends OCPPServiceUtils { chargingStation, transactionId, 0, - false, measurandsKey, OCPP20ReadingContextEnumType.TRANSACTION_END ) as OCPP20MeterValue diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index 4f0f3518..517159c3 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -1577,9 +1577,9 @@ export const buildMeterValue = ( chargingStation: ChargingStation, transactionId: number | string | undefined, interval: number, - debug = false, measurandsKey?: ConfigurationKeyType, - context?: MeterValueContext + context?: MeterValueContext, + debug = false ): MeterValue => { if (transactionId == null) { return buildEmptyMeterValue()