From: Jérôme Benoit Date: Fri, 24 Nov 2023 00:11:41 +0000 (+0100) Subject: refactor: remove unneeded registration status getter X-Git-Tag: v1.2.26~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=05e2446f43d2fb81bfdfe43684186acdeb490085;p=e-mobility-charging-stations-simulator.git refactor: remove unneeded registration status getter Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 0cd8dba9..f0fa0820 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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); } diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 2c90e1a3..b9a75e5f 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -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, ); }