Small variable namespace cleanups
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Mar 2022 15:38:16 +0000 (16:38 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Mar 2022 15:38:16 +0000 (16:38 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts

index 5393aebdbccf881cad95bea23c4edc3e0ad6a43c..507246b538fc7a0bfd54493dfea958e1d6207e73 100644 (file)
@@ -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()})`
       );
index 23d8a014472d0bc2f5bd3726d9f215db163a397d..64b49c46d4f2f165ec320d56fcfead811babf048 100644 (file)
@@ -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(
@@ -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 (
@@ -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(
@@ -410,7 +411,7 @@ export class OCPP16ServiceUtils {
               meterValue.sampledValue[sampledValuesPerPhaseIndex].phase
             }, connectorId ${connectorId}, transaction ${connector.transactionId}, value: ${
               meterValue.sampledValue[sampledValuesPerPhaseIndex].value
-            }/${maxPowerPerPhaseRounded}`
+            }/${maximumPowerPerPhaseRounded}`
           );
         }
       }