X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16RequestService.ts;h=aa0ca4f16bf5a7230364e9ceb2b025f8ebbf240b;hb=ada189a839743451d477d5b3bddc698f2634d799;hp=1c98bc37d4c6b25f2b897f07aea86fa0414014ab;hpb=7645760b75ac201b8ec0b8378b986cabacce7807;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index 1c98bc37..aa0ca4f1 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -29,10 +29,7 @@ export default class OCPP16RequestService extends OCPPRequestService { commandParams?: JsonType, params?: RequestParams ): Promise { - if ( - Object.values(OCPP16RequestCommand).includes(commandName) && - ChargingStationUtils.isCommandSupported(commandName, chargingStation) - ) { + if (ChargingStationUtils.isRequestCommandSupported(commandName, chargingStation)) { return (await this.sendMessage( chargingStation, Utils.generateUUID(), @@ -43,7 +40,7 @@ export default class OCPP16RequestService extends OCPPRequestService { } throw new OCPPError( ErrorType.NOT_SUPPORTED, - `${moduleName}.requestHandler: Unsupported OCPP command ${commandName}`, + `${moduleName}.requestHandler: Unsupported OCPP command '${commandName}'`, commandName, commandParams ); @@ -148,7 +145,7 @@ export default class OCPP16RequestService extends OCPPRequestService { throw new OCPPError( ErrorType.NOT_SUPPORTED, // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `${moduleName}.buildRequestPayload: Unsupported OCPP command: ${commandName}`, + `${moduleName}.buildRequestPayload: Unsupported OCPP command '${commandName}'`, commandName, commandParams );