X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16ServiceUtils.ts;h=0599cfa0e07915d7bd77429bf4e412c1f178d269;hb=fa7bccf4a465d2156c43a3b5f33f0b521da52dc3;hp=1c8e1369b25fe997e9aac7ac509b3a91eb9c4920;hpb=ccb1d6e97cc0248cd96a9505cf5e8f037d66984c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 1c8e1369..0599cfa0 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -770,16 +770,16 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { chargingStation: ChargingStation, measurandType: OCPP16MeterValueMeasurand ): void { - if (Utils.isUndefined(chargingStation.stationInfo.powerDivider)) { + if (Utils.isUndefined(chargingStation.powerDivider)) { const errMsg = `${chargingStation.logPrefix()} MeterValues measurand ${ measurandType ?? OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER }: powerDivider is undefined`; logger.error(errMsg); throw new OCPPError(ErrorType.INTERNAL_ERROR, errMsg, OCPP16RequestCommand.METER_VALUES); - } else if (chargingStation.stationInfo?.powerDivider <= 0) { + } else if (chargingStation?.powerDivider <= 0) { const errMsg = `${chargingStation.logPrefix()} MeterValues measurand ${ measurandType ?? OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER - }: powerDivider have zero or below value ${chargingStation.stationInfo.powerDivider}`; + }: powerDivider have zero or below value ${chargingStation.powerDivider}`; logger.error(errMsg); throw new OCPPError(ErrorType.INTERNAL_ERROR, errMsg, OCPP16RequestCommand.METER_VALUES); }