Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Small variable namespace cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
  • Loading branch information
Jérôme Benoit committed Mar 18, 2022
1 parent da57964 commit 71a77ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/charging-station/ChargingStation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ export default class ChargingStation {
this.wsConnectionRestarted = true;
} else if (this.getAutoReconnectMaxRetries() !== -1) {
logger.error(
`${this.logPrefix()} WebSocket reconnect failure: max retries reached (${
`${this.logPrefix()} WebSocket reconnect failure: maximum retries reached (${
this.autoReconnectRetryCount
}) or retry disabled (${this.getAutoReconnectMaxRetries()})`
);
Expand Down
13 changes: 7 additions & 6 deletions src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,10 @@ export class OCPP16ServiceUtils {
)
);
const sampledValuesIndex = meterValue.sampledValue.length - 1;
const maxPowerRounded = Utils.roundTo(maximumPower / unitDivider, 2);
const maximumPowerRounded = Utils.roundTo(maximumPower / unitDivider, 2);
if (
Utils.convertToFloat(meterValue.sampledValue[sampledValuesIndex].value) > maxPowerRounded ||
Utils.convertToFloat(meterValue.sampledValue[sampledValuesIndex].value) >
maximumPowerRounded ||
debug
) {
logger.error(
Expand All @@ -377,7 +378,7 @@ export class OCPP16ServiceUtils {
OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
}: connectorId ${connectorId}, transaction ${connector.transactionId}, value: ${
meterValue.sampledValue[sampledValuesIndex].value
}/${maxPowerRounded}`
}/${maximumPowerRounded}`
);
}
for (
Expand All @@ -396,10 +397,10 @@ export class OCPP16ServiceUtils {
)
);
const sampledValuesPerPhaseIndex = meterValue.sampledValue.length - 1;
const maxPowerPerPhaseRounded = Utils.roundTo(maximumPowerPerPhase / unitDivider, 2);
const maximumPowerPerPhaseRounded = Utils.roundTo(maximumPowerPerPhase / unitDivider, 2);
if (
Utils.convertToFloat(meterValue.sampledValue[sampledValuesPerPhaseIndex].value) >
maxPowerPerPhaseRounded ||
maximumPowerPerPhaseRounded ||
debug
) {
logger.error(
Expand All @@ -410,7 +411,7 @@ export class OCPP16ServiceUtils {
meterValue.sampledValue[sampledValuesPerPhaseIndex].phase
}, connectorId ${connectorId}, transaction ${connector.transactionId}, value: ${
meterValue.sampledValue[sampledValuesPerPhaseIndex].value
}/${maxPowerPerPhaseRounded}`
}/${maximumPowerPerPhaseRounded}`
);
}
}
Expand Down

0 comments on commit 71a77ac

Please sign in to comment.