fix: add sanity check at evses initialization
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 27 Apr 2023 19:48:35 +0000 (21:48 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 27 Apr 2023 19:48:35 +0000 (21:48 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index d830d74754a507f61336862cd4aaca887510f6bc..928a8317f94db5f04c65d53be16c844b7a5705c9 100644 (file)
@@ -1411,6 +1411,13 @@ export class ChargingStation {
         } with no evse id 0 configuration`
       );
     }
+    if (!stationInfo?.Evses[0]?.Connectors[0]) {
+      logger.warn(
+        `${this.logPrefix()} Charging station information from template ${
+          this.templateFile
+        } with evse id 0 with no connector id 0 configuration`
+      );
+    }
     if (stationInfo?.Evses) {
       const evsesConfigHash = crypto
         .createHash(Constants.DEFAULT_HASH_ALGORITHM)