From: Jérôme Benoit Date: Fri, 20 Mar 2026 19:10:38 +0000 (+0100) Subject: fix(ocpp2.0): guard BroadcastChannel MeterValues for both VERSION_20 and VERSION_201 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9c0fcfda63dbbf24bbb240f2d4ba45667fbd9c9a;p=e-mobility-charging-stations-simulator.git fix(ocpp2.0): guard BroadcastChannel MeterValues for both VERSION_20 and VERSION_201 The early return in handleMeterValues only checked VERSION_201, missing VERSION_20. A station configured with ocppVersion '2.0' would fall through to the OCPP 1.6 path and call convertToInt on a UUID string. --- diff --git a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts index ba414170..57a87856 100644 --- a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts @@ -470,7 +470,10 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne private async handleMeterValues ( requestPayload?: BroadcastChannelRequestPayload ): Promise { - if (this.chargingStation.stationInfo?.ocppVersion === OCPPVersion.VERSION_201) { + if ( + this.chargingStation.stationInfo?.ocppVersion === OCPPVersion.VERSION_20 || + this.chargingStation.stationInfo?.ocppVersion === OCPPVersion.VERSION_201 + ) { return await this.chargingStation.ocppRequestService.requestHandler< MeterValuesRequest, MeterValuesResponse