From: Jérôme Benoit Date: Mon, 17 May 2021 22:20:36 +0000 (+0200) Subject: Code cleanups X-Git-Tag: v1.0.1-0~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f0c6ed89c8a599aced872758ca1c3139d417de44;p=e-mobility-charging-stations-simulator.git Code cleanups Signed-off-by: Jérôme Benoit --- 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]) {