Add charging station instance id
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 13 Feb 2022 20:00:25 +0000 (21:00 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 13 Feb 2022 20:00:25 +0000 (21:00 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index e05ad162d24a1d28dc02df1bb67f2d42b7134826..84756ab7caec814b9ac8f2d90a3f5ef91e609948 100644 (file)
@@ -52,6 +52,7 @@ export default class ChargingStation {
   public performanceStatistics!: PerformanceStatistics;
   public heartbeatSetInterval!: NodeJS.Timeout;
   public ocppRequestService!: OCPPRequestService;
+  private readonly id: string;
   private readonly index: number;
   private bootNotificationRequest!: BootNotificationRequest;
   private bootNotificationResponse!: BootNotificationResponse | null;
@@ -66,6 +67,7 @@ export default class ChargingStation {
   private webSocketPingSetInterval!: NodeJS.Timeout;
 
   constructor(index: number, stationTemplateFile: string) {
+    this.id = Utils.generateUUID();
     this.index = index;
     this.stationTemplateFile = stationTemplateFile;
     this.connectors = new Map<number, ConnectorStatus>();