refactor: remove unneeded registration status getter
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 24 Nov 2023 00:11:41 +0000 (01:11 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 24 Nov 2023 00:11:41 +0000 (01:11 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/OCPPRequestService.ts

index 0cd8dba90612f6d9fd57f5e3a5444aedea1a867a..f0fa08208c79241bf23d0c7cdd05b4c1d7e14991 100644 (file)
@@ -264,10 +264,6 @@ export class ChargingStation extends EventEmitter {
     return this?.wsConnection?.readyState === WebSocket.OPEN;
   }
 
-  public getRegistrationStatus(): RegistrationStatusEnumType | undefined {
-    return this?.bootNotificationResponse?.status;
-  }
-
   public inUnknownState(): boolean {
     return isNullOrUndefined(this?.bootNotificationResponse?.status);
   }
index 2c90e1a374df1bcc6ee5bf88a2f3f53a4ffa4bec..b9a75e5f943388b33b07be80e1654e47acf6cb3c 100644 (file)
@@ -478,7 +478,7 @@ export abstract class OCPPRequestService {
     }
     throw new OCPPError(
       ErrorType.SECURITY_ERROR,
-      `Cannot send command ${commandName} PDU when the charging station is in ${chargingStation.getRegistrationStatus()} state on the central server`,
+      `Cannot send command ${commandName} PDU when the charging station is in ${chargingStation?.bootNotificationResponse?.status} state on the central server`,
       commandName,
     );
   }