X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.ts;h=7b98ed35858bd4c524cccb1af9222c0100e3922b;hb=ed6cfcff3ef6596cdf76c68f600effcb25dece72;hp=40b846217556023b671d8f31a0f5d7996cc2bd0c;hpb=d56ea27cd1c2e1df9317602551c443a720e1c7cb;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 40b84621..7b98ed35 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -216,7 +216,10 @@ export default class ChargingStation { } public isRegistered(): boolean { - return !this.isInUnknownState() && (this.isInAcceptedState() || this.isInPendingState()); + return ( + this.isInUnknownState() === false && + (this.isInAcceptedState() === true || this.isInPendingState() === true) + ); } public isChargingStationAvailable(): boolean { @@ -1326,7 +1329,7 @@ export default class ChargingStation { 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 { @@ -1336,7 +1339,7 @@ export default class ChargingStation { >(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 @@ -1345,12 +1348,12 @@ export default class ChargingStation { ); } } 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(); } @@ -1764,8 +1767,7 @@ export default class ChargingStation { } else if ( !this.getConnectorStatus(connectorId)?.status && (this.isChargingStationAvailable() === false || - (this.isChargingStationAvailable() === true && - this.isConnectorAvailable(connectorId) === false)) + this.isConnectorAvailable(connectorId) === false) ) { chargePointStatus = ChargePointStatus.UNAVAILABLE; } else if (