context?: MeterValueContext,
phase?: OCPP16MeterValuePhase,
): OCPP16SampledValue {
- const sampledValueValue = value ?? sampledValueTemplate?.value;
const sampledValueContext = context ?? sampledValueTemplate?.context;
const sampledValueLocation =
sampledValueTemplate?.location ??
measurand: sampledValueTemplate.measurand,
}),
...(!isNullOrUndefined(sampledValueLocation) && { location: sampledValueLocation }),
- ...(!isNullOrUndefined(sampledValueValue) && { value: sampledValueValue.toString() }),
+ ...(!isNullOrUndefined(value) && { value: value.toString() }),
...(!isNullOrUndefined(sampledValuePhase) && { phase: sampledValuePhase }),
} as OCPP16SampledValue;
}