From 314793aaf25bf1a99deb3f8209c09421235942ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 14 Apr 2024 21:10:38 +0200 Subject: [PATCH] refactor: silence typing errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/AutomaticTransactionGenerator.ts | 6 +++--- src/charging-station/ChargingStation.ts | 2 +- .../ocpp/1.6/OCPP16IncomingRequestService.ts | 11 ++++++----- src/charging-station/ocpp/OCPPRequestService.ts | 1 - 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index a6143a8c..4b9b8f6c 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -475,7 +475,7 @@ export class AutomaticTransactionGenerator { logger.info(startTransactionLogMsg) // Start transaction startResponse = await this.chargingStation.ocppRequestService.requestHandler< - StartTransactionRequest, + Partial, StartTransactionResponse >(this.chargingStation, RequestCommand.START_TRANSACTION, { connectorId, @@ -493,7 +493,7 @@ export class AutomaticTransactionGenerator { logger.info(startTransactionLogMsg) // Start transaction startResponse = await this.chargingStation.ocppRequestService.requestHandler< - StartTransactionRequest, + Partial, StartTransactionResponse >(this.chargingStation, RequestCommand.START_TRANSACTION, { connectorId, @@ -505,7 +505,7 @@ export class AutomaticTransactionGenerator { } logger.info(`${this.logPrefix(connectorId)} start transaction without an idTag`) startResponse = await this.chargingStation.ocppRequestService.requestHandler< - StartTransactionRequest, + Partial, StartTransactionResponse >(this.chargingStation, RequestCommand.START_TRANSACTION, { connectorId }) this.handleStartTransactionResponse(connectorId, startResponse) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index ecd858c9..c31c00f7 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -943,7 +943,7 @@ export class ChargingStation extends EventEmitter { ) } return await this.ocppRequestService.requestHandler< - StopTransactionRequest, + Partial, StopTransactionResponse >(this, RequestCommand.STOP_TRANSACTION, { transactionId, diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index 6cafcd4b..84fb39c1 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -422,7 +422,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion chargingStation.getConnectorStatus(connectorId)!.transactionRemoteStarted = true chargingStation.ocppRequestService - .requestHandler( + .requestHandler, OCPP16StartTransactionResponse>( chargingStation, OCPP16RequestCommand.START_TRANSACTION, { @@ -505,7 +505,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { .requestHandler( chargingStation, OCPP16RequestCommand.BOOT_NOTIFICATION, - chargingStation.bootNotificationRequest, + chargingStation.bootNotificationRequest as OCPP16BootNotificationRequest, { skipBufferingOnError: true, triggerMessage: true } ) .then(response => { @@ -534,7 +534,8 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { { connectorId, errorCode: OCPP16ChargePointErrorCode.NO_ERROR, - status: chargingStation.getConnectorStatus(connectorId)?.status + status: chargingStation.getConnectorStatus(connectorId) + ?.status as OCPP16ChargePointStatus }, { triggerMessage: true @@ -554,7 +555,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { { connectorId: id, errorCode: OCPP16ChargePointErrorCode.NO_ERROR, - status: connectorStatus.status + status: connectorStatus.status as OCPP16ChargePointStatus }, { triggerMessage: true @@ -575,7 +576,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { { connectorId: id, errorCode: OCPP16ChargePointErrorCode.NO_ERROR, - status: connectorStatus.status + status: connectorStatus.status as OCPP16ChargePointStatus }, { triggerMessage: true diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 3ac768c2..3a27a192 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -477,7 +477,6 @@ export abstract class OCPPRequestService { ]) } - // eslint-disable-next-line @typescript-eslint/no-unused-vars public abstract requestHandler( chargingStation: ChargingStation, commandName: RequestCommand, -- 2.34.1