undefined,
measurandsKey
)
- if (powerMeasurand != null) {
+ if (powerMeasurand?.values.allPhases != null) {
const unitDivider = powerMeasurand.template.unit === MeterValueUnit.KILO_WATT ? 1000 : 1
const connectorMaximumAvailablePower =
chargingStation.getConnectorMaximumAvailablePower(connectorId)
undefined,
measurandsKey
)
- if (currentMeasurand != null) {
+ if (currentMeasurand?.values.allPhases != null) {
const connectorMaximumAvailablePower =
chargingStation.getConnectorMaximumAvailablePower(connectorId)
const connectorMaximumAmperage =
context: fields.context,
location: fields.location,
measurand: fields.measurand,
- unit: fields.unit,
+ ...(fields.unit != null && { unit: fields.unit }),
value: fields.value.toString(),
...(fields.phase != null && { phase: fields.phase }),
} as OCPP16SampledValue
context: fields.context,
location: fields.location,
measurand: fields.measurand,
- ...(fields.unit !== undefined && { unitOfMeasure: { unit: fields.unit } }),
+ ...(fields.unit != null && { unitOfMeasure: { unit: fields.unit } }),
value: fields.value,
...(fields.phase != null && { phase: fields.phase }),
} as OCPP20SampledValue