X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F2.0%2FOCPP20ResponseService.ts;h=111b114a34048113c4fdf2a60a77133570fe4405;hb=969c488ddeab6f7fb11a376a4a4d1db497aef96d;hp=4727194659aaad501a1f06e127eae9530f0278ee;hpb=a37fc6dc8267e22b2b2d35773525980b81f014e8;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/2.0/OCPP20ResponseService.ts b/src/charging-station/ocpp/2.0/OCPP20ResponseService.ts index 47271946..111b114a 100644 --- a/src/charging-station/ocpp/2.0/OCPP20ResponseService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20ResponseService.ts @@ -3,11 +3,10 @@ import type { JSONSchemaType } from 'ajv'; import { OCPP20ServiceUtils } from './OCPP20ServiceUtils'; -import { type ChargingStation, ChargingStationConfigurationUtils } from '../../../charging-station'; +import { type ChargingStation, addConfigurationKey } from '../../../charging-station'; import { OCPPError } from '../../../exception'; import { ErrorType, - type JsonObject, type JsonType, type OCPP20BootNotificationResponse, type OCPP20ClearCacheResponse, @@ -28,11 +27,11 @@ const moduleName = 'OCPP20ResponseService'; export class OCPP20ResponseService extends OCPPResponseService { public jsonIncomingRequestResponseSchemas: Map< OCPP20IncomingRequestCommand, - JSONSchemaType + JSONSchemaType >; private responseHandlers: Map; - private jsonSchemas: Map>; + private jsonSchemas: Map>; public constructor() { // if (new.target?.name === moduleName) { @@ -50,7 +49,7 @@ export class OCPP20ResponseService extends OCPPResponseService { this.emptyResponseHandler.bind(this) as ResponseHandler, ], ]); - this.jsonSchemas = new Map>([ + this.jsonSchemas = new Map>([ [ OCPP20RequestCommand.BOOT_NOTIFICATION, OCPP20ServiceUtils.parseJsonSchemaFile( @@ -123,7 +122,7 @@ export class OCPP20ResponseService extends OCPPResponseService { ErrorType.NOT_IMPLEMENTED, `${commandName} is not implemented to handle response PDU ${JSON.stringify( payload, - null, + undefined, 2, )}`, commandName, @@ -135,7 +134,7 @@ export class OCPP20ResponseService extends OCPPResponseService { ErrorType.SECURITY_ERROR, `${commandName} cannot be issued to handle response PDU ${JSON.stringify( payload, - null, + undefined, 2, )} while the charging station is not registered on the central server.`, commandName, @@ -168,7 +167,7 @@ export class OCPP20ResponseService extends OCPPResponseService { payload: OCPP20BootNotificationResponse, ): void { if (payload.status === RegistrationStatusEnumType.ACCEPTED) { - ChargingStationConfigurationUtils.addConfigurationKey( + addConfigurationKey( chargingStation, OCPP20OptionalVariableName.HeartbeatInterval, payload.interval.toString(),