X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorkerBroadcastChannel.ts;h=c03c4acb81db8aae2a01efee281e5558fbfb3a81;hb=e8044a69a745aab08dfeea0bd9ec9dd7fe84cdd7;hp=787b349a868326c0658a0e8d875b0e1571f313bd;hpb=60a743910478b70e39dcefa5e1b752ec8a93880e;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts index 787b349a..c03c4acb 100644 --- a/src/charging-station/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/ChargingStationWorkerBroadcastChannel.ts @@ -92,6 +92,11 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne (requestPayload?: BroadcastChannelRequestPayload) => this.chargingStation.stopAutomaticTransactionGenerator(requestPayload?.connectorIds), ], + [ + BroadcastChannelProcedureName.SET_SUPERVISION_URL, + (requestPayload?: BroadcastChannelRequestPayload) => + this.chargingStation.setSupervisionUrl(requestPayload?.url as string), + ], [ BroadcastChannelProcedureName.START_TRANSACTION, async (requestPayload?: BroadcastChannelRequestPayload) => @@ -253,12 +258,12 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne } const [uuid, command, requestPayload] = validatedMessageEvent.data as BroadcastChannelRequest; if ( - requestPayload?.hashIds !== undefined && + !Utils.isNullOrUndefined(requestPayload?.hashIds) && requestPayload?.hashIds?.includes(this.chargingStation.stationInfo.hashId) === false ) { return; } - if (requestPayload?.hashId !== undefined) { + if (!Utils.isNullOrUndefined(requestPayload?.hashId)) { logger.error( `${this.chargingStation.logPrefix()} ${moduleName}.requestHandler: 'hashId' field usage in PDU is deprecated, use 'hashIds' array instead` ); @@ -269,8 +274,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne try { commandResponse = await this.commandHandler(command, requestPayload); if ( - commandResponse === undefined || - commandResponse === null || + Utils.isNullOrUndefined(commandResponse) || Utils.isEmptyObject(commandResponse as CommandResponse) ) { responsePayload = {