}
public isRegistered(): boolean {
- return !this.isInUnknownState() && (this.isInAcceptedState() || this.isInPendingState());
+ return (
+ this.isInUnknownState() === false &&
+ (this.isInAcceptedState() === true || this.isInPendingState() === true)
+ );
}
public isChargingStationAvailable(): boolean {
logger.info(
`${this.logPrefix()} Connection to OCPP server through ${this.wsConnectionUrl.toString()} succeeded`
);
- if (!this.isRegistered()) {
+ if (this.isRegistered() === false) {
// Send BootNotification
let registrationRetryCount = 0;
do {
>(this, RequestCommand.BOOT_NOTIFICATION, this.bootNotificationRequest, {
skipBufferingOnError: true,
});
- if (!this.isRegistered()) {
+ if (this.isRegistered() === false) {
this.getRegistrationMaxRetries() !== -1 && registrationRetryCount++;
await Utils.sleep(
this.bootNotificationResponse?.interval
);
}
} while (
- !this.isRegistered() &&
+ this.isRegistered() === false &&
(registrationRetryCount <= this.getRegistrationMaxRetries() ||
this.getRegistrationMaxRetries() === -1)
);
}
- if (this.isRegistered()) {
+ if (this.isRegistered() === true) {
if (this.isInAcceptedState()) {
await this.startMessageSequence();
}
);
}
if (
- chargingStation.isRegistered() ||
- (!chargingStation.getOcppStrictCompliance() && chargingStation.isInUnknownState())
+ chargingStation.isRegistered() === true ||
+ (chargingStation.getOcppStrictCompliance() === false &&
+ chargingStation.isInUnknownState() === true)
) {
if (
- this.incomingRequestHandlers.has(commandName) &&
- OCPP16ServiceUtils.isIncomingRequestCommandSupported(chargingStation, commandName)
+ this.incomingRequestHandlers.has(commandName) === true &&
+ OCPP16ServiceUtils.isIncomingRequestCommandSupported(chargingStation, commandName) === true
) {
try {
this.validatePayload(chargingStation, commandName, commandPayload);
commandParams?: JsonType,
params?: RequestParams
): Promise<ResponseType> {
- if (OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName)) {
+ if (OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName) === true) {
const requestPayload = this.buildRequestPayload<RequestType>(
chargingStation,
commandName,
payload: JsonType,
requestPayload: JsonType
): Promise<void> {
- if (chargingStation.isRegistered() || commandName === OCPP16RequestCommand.BOOT_NOTIFICATION) {
+ if (
+ chargingStation.isRegistered() === true ||
+ commandName === OCPP16RequestCommand.BOOT_NOTIFICATION
+ ) {
if (
- this.responseHandlers.has(commandName) &&
- OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName)
+ this.responseHandlers.has(commandName) === true &&
+ OCPP16ServiceUtils.isRequestCommandSupported(chargingStation, commandName) === true
) {
try {
this.validatePayload(chargingStation, commandName, payload);