fix: fix number of available evses calculation
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 28 Apr 2023 12:25:35 +0000 (14:25 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 28 Apr 2023 12:25:35 +0000 (14:25 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 6ea862e75030f40c6a9eee751e178b7ed1febc50..70f511e0878c6d16944f046dde834c73d2fdc4b7 100644 (file)
@@ -263,11 +263,11 @@ export class ChargingStation {
       }
       return numberOfConnectors;
     }
-    return this.connectors.get(0) ? this.connectors.size - 1 : this.connectors.size;
+    return this.connectors.has(0) ? this.connectors.size - 1 : this.connectors.size;
   }
 
   public getNumberOfEvses(): number {
-    return this.evses.size;
+    return this.evses.has(0) ? this.evses.size - 1 : this.evses.size;
   }
 
   public getConnectorStatus(connectorId: number): ConnectorStatus | undefined {