From f0c6ed89c8a599aced872758ca1c3139d417de44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 18 May 2021 00:20:36 +0200 Subject: [PATCH] Code cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16ResponseService.ts | 2 +- src/utils/PerformanceStatistics.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index b06f1c74..e9d2d2e9 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -50,7 +50,7 @@ export default class OCPP16ResponseService extends OCPPResponseService { return; } - if (payload?.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { + if (payload.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { this.chargingStation.getConnector(connectorId).transactionStarted = true; this.chargingStation.getConnector(connectorId).transactionId = payload.transactionId; this.chargingStation.getConnector(connectorId).idTag = requestPayload.idTag; diff --git a/src/utils/PerformanceStatistics.ts b/src/utils/PerformanceStatistics.ts index 513c4ff1..bcd0b71f 100644 --- a/src/utils/PerformanceStatistics.ts +++ b/src/utils/PerformanceStatistics.ts @@ -112,13 +112,13 @@ export default class PerformanceStatistics { private addPerformanceTimer(command: RequestCommand | IncomingRequestCommand, duration: number): void { // Map to proper command name - const MAPCOMMAND = { + const MAP_COMMAND = { sendMeterValues: RequestCommand.METER_VALUES, startTransaction: RequestCommand.START_TRANSACTION, stopTransaction: RequestCommand.STOP_TRANSACTION, }; - if (MAPCOMMAND[command]) { - command = MAPCOMMAND[command] as RequestCommand | IncomingRequestCommand; + if (MAP_COMMAND[command]) { + command = MAP_COMMAND[command] as RequestCommand | IncomingRequestCommand; } // Initialize command statistics if (!this.commandsStatistics.commandsStatisticsData[command]) { -- 2.34.1