Skip to content

Commit

Permalink
fix: fallback to minimum measurand value at meterValues generation
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
Jérôme Benoit committed Nov 15, 2023
1 parent 0b0ca54 commit 5bb45fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumPower / unitDivider,
},
) / chargingStation.getNumberOfPhases(),
powerSampledValueTemplate.fluctuationPercent ??
Expand All @@ -317,6 +318,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumPowerPerPhase / unitDivider,
},
),
powerPerPhaseSampledValueTemplates.L1.fluctuationPercent ??
Expand All @@ -331,6 +333,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumPowerPerPhase / unitDivider,
},
),
powerPerPhaseSampledValueTemplates.L2.fluctuationPercent ??
Expand All @@ -345,6 +348,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumPowerPerPhase / unitDivider,
},
),
powerPerPhaseSampledValueTemplates.L3.fluctuationPercent ??
Expand Down Expand Up @@ -380,6 +384,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumPower / unitDivider,
},
),
powerSampledValueTemplate.fluctuationPercent ??
Expand All @@ -406,6 +411,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumPower / unitDivider,
},
),
powerSampledValueTemplate.fluctuationPercent ??
Expand Down Expand Up @@ -555,6 +561,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumAmperage,
},
),
currentSampledValueTemplate.fluctuationPercent ??
Expand All @@ -569,6 +576,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumAmperage,
},
),
currentPerPhaseSampledValueTemplates.L1.fluctuationPercent ??
Expand All @@ -583,6 +591,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumAmperage,
},
),
currentPerPhaseSampledValueTemplates.L2.fluctuationPercent ??
Expand All @@ -597,6 +606,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumAmperage,
},
),
currentPerPhaseSampledValueTemplates.L3.fluctuationPercent ??
Expand All @@ -623,6 +633,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumAmperage,
},
),
currentSampledValueTemplate.fluctuationPercent ??
Expand Down Expand Up @@ -651,6 +662,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
{
limitationEnabled:
chargingStation.stationInfo?.customValueLimitationMeterValues,
defaultValue: connectorMinimumAmperage,
},
),
currentSampledValueTemplate.fluctuationPercent ??
Expand Down

0 comments on commit 5bb45fe

Please sign in to comment.