From: Jérôme Benoit Date: Sun, 14 Apr 2024 19:10:38 +0000 (+0200) Subject: refactor: silence typing errors X-Git-Tag: v1.3.3~19 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=314793aaf25bf1a99deb3f8209c09421235942ba;p=e-mobility-charging-stations-simulator.git refactor: silence typing errors Signed-off-by: Jérôme Benoit --- 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,