Fix chargeBoxSerialNumberPrefix template tunable handling.
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 31 Oct 2020 12:00:43 +0000 (13:00 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 31 Oct 2020 12:00:43 +0000 (13:00 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/assets/station-templates/evlink.station-template.json
src/assets/station-templates/schneider-imredd.station-template.json
src/assets/station-templates/schneider.station-template.json
src/charging-station/ChargingStation.js

index caa18f745b6397695e6bf639eabebd649e464cba..f340b9851c0b0d37b8269d6f82f57a3e9c422b55 100644 (file)
@@ -3,7 +3,7 @@
   "baseName": "CS-EVLINK",
   "chargePointModel": "MONOBLOCK",
   "chargePointVendor": "Schneider Electric",
-  "chargePointSerialNumberPrefix": "EV.2S7P04",
+  "chargeBoxSerialNumberPrefix": "EV.2S7P04",
   "firmwareVersion": "3.3.0.10",
   "power": 7360,
   "powerUnit": "W",
index 40529ff9ad554e0284f679dde6331b96cf99c01c..1606c8f03c087a71a93cbe9de32313a97291b8df 100644 (file)
@@ -3,7 +3,7 @@
   "baseName": "CS-SCHNEIDER",
   "chargePointModel": "MONOBLOCK",
   "chargePointVendor": "Schneider Electric",
-  "chargePointSerialNumberPrefix": "EV.2S22P04",
+  "chargeBoxSerialNumberPrefix": "EV.2S22P04",
   "firmwareVersion": "3.3.0.10",
   "power": 22080,
   "powerUnit": "W",
index 9b442401bd8a3ff4e67eff9991fe19324dff1646..5583cf04e1f91428455680b756a9fd2800f99ca5 100644 (file)
@@ -3,7 +3,7 @@
   "baseName": "CS-SCHNEIDER",
   "chargePointModel": "MONOBLOCK",
   "chargePointVendor": "Schneider Electric",
-  "chargePointSerialNumberPrefix": "EV.2S22P44",
+  "chargeBoxSerialNumberPrefix": "EV.2S22P44",
   "firmwareVersion": "3.3.0.10",
   "power": 44160,
   "powerUnit": "W",
index 1ffcfab72f9923001770364de10166e9eb632df9..28ae1707b49d863bb49098e62fd00ae52af31d20 100644 (file)
@@ -61,7 +61,7 @@ export default class ChargingStation {
     this._bootNotificationMessage = {
       chargePointModel: this._stationInfo.chargePointModel,
       chargePointVendor: this._stationInfo.chargePointVendor,
-      ...!Utils.isUndefined(this._stationInfo.chargePointSerialNumberPrefix) && {chargePointSerialNumber: this._stationInfo.chargePointSerialNumberPrefix},
+      ...!Utils.isUndefined(this._stationInfo.chargeBoxSerialNumberPrefix) && {chargeBoxSerialNumber: this._stationInfo.chargeBoxSerialNumberPrefix},
       ...!Utils.isUndefined(this._stationInfo.firmwareVersion) && {firmwareVersion: this._stationInfo.firmwareVersion},
     };
     this._configuration = this._getConfiguration();
@@ -941,7 +941,7 @@ export default class ChargingStation {
       this._addConfigurationKey('HeartbeatInterval', Utils.convertToInt(payload.interval), false, false);
       this._basicStartMessageSequence();
     } else if (payload.status === 'Pending') {
-      logger.info(this._logPrefix() + ' Charging station pending on the central server');
+      logger.info(this._logPrefix() + ' Charging station in pending state on the central server');
     } else {
       logger.info(this._logPrefix() + ' Charging station rejected by the central server');
     }
@@ -1040,10 +1040,10 @@ export default class ChargingStation {
     }
     let response;
     // Call
-    if (typeof this['handle' + commandName] === 'function') {
+    if (typeof this['handleRequest' + commandName] === 'function') {
       try {
         // Call the method to build the response
-        response = await this['handle' + commandName](commandPayload);
+        response = await this['handleRequest' + commandName](commandPayload);
       } catch (error) {
         // Log
         logger.error(this._logPrefix() + ' Handle request error: ' + error);
@@ -1059,8 +1059,8 @@ export default class ChargingStation {
     await this.sendMessage(messageId, response, Constants.OCPP_JSON_CALL_RESULT_MESSAGE);
   }
 
-  async handleReset(commandPayload) {
-    // Simulate charging station restart
+  // Simulate charging station restart
+  async handleRequestReset(commandPayload) {
     setImmediate(async () => {
       await this.stop(commandPayload.type + 'Reset');
       await Utils.sleep(this._stationInfo.resetTime);
@@ -1095,7 +1095,7 @@ export default class ChargingStation {
     }
   }
 
-  async handleGetConfiguration(commandPayload) {
+  async handleRequestGetConfiguration(commandPayload) {
     const configurationKey = [];
     const unknownKey = [];
     if (Utils.isEmptyArray(commandPayload.key)) {
@@ -1142,7 +1142,7 @@ export default class ChargingStation {
     };
   }
 
-  async handleChangeConfiguration(commandPayload) {
+  async handleRequestChangeConfiguration(commandPayload) {
     const keyToChange = this._getConfigurationKey(commandPayload.key);
     if (!keyToChange) {
       return {status: Constants.OCPP_ERROR_NOT_SUPPORTED};
@@ -1174,9 +1174,9 @@ export default class ChargingStation {
     }
   }
 
-  async handleRemoteStartTransaction(commandPayload) {
+  async handleRequestRemoteStartTransaction(commandPayload) {
     const transactionConnectorID = commandPayload.connectorId ? commandPayload.connectorId : '1';
-    if (this.hasAuthorizedTags() && this._getLocalAuthListEnabled() && this._getAuthorizeRemoteTxRequests()) {
+    if (this._getAuthorizeRemoteTxRequests() && this._getLocalAuthListEnabled() && this.hasAuthorizedTags()) {
       // Check if authorized
       if (this._authorizedTags.find((value) => value === commandPayload.idTag)) {
         // Authorization successful start transaction
@@ -1193,7 +1193,7 @@ export default class ChargingStation {
     return Constants.OCPP_RESPONSE_ACCEPTED;
   }
 
-  async handleRemoteStopTransaction(commandPayload) {
+  async handleRequestRemoteStopTransaction(commandPayload) {
     for (const connector in this._connectors) {
       if (this.getConnector(connector).transactionId === commandPayload.transactionId) {
         this.sendStopTransaction(commandPayload.transactionId);