fix: ensure voltage is defined in stationInfo
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Nov 2023 21:12:07 +0000 (22:12 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Nov 2023 21:12:07 +0000 (22:12 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 8cdde246cebb00a52d296ef0587a266f4d3eb5a7..94b6d8bd1145529506f0c198c6fbf033124ce607 100644 (file)
@@ -1115,6 +1115,7 @@ export class ChargingStation extends EventEmitter {
     stationInfo.chargingStationId = getChargingStationId(this.index, stationTemplate);
     stationInfo.ocppVersion = stationTemplate?.ocppVersion ?? OCPPVersion.VERSION_16;
     createSerialNumber(stationTemplate, stationInfo);
+    stationInfo.voltageOut = this.getVoltageOut(stationInfo);
     if (isNotEmptyArray(stationTemplate?.power)) {
       stationTemplate.power = stationTemplate.power as number[];
       const powerArrayRandomIndex = Math.floor(secureRandom() * stationTemplate.power.length);