From 25f5a959c137b7d302485e8ef6ca9d4a2f1cb6f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 12 Mar 2022 21:00:22 +0100 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/ChargingStation.ts | 11 +---------- src/utils/Configuration.ts | 2 +- src/utils/Constants.ts | 2 ++ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 01829fdf..e8122d18 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -102,7 +102,7 @@ export default class ChargingStation { this.authorizedTags = this.getAuthorizedTags(); } - get wsConnectionUrl(): URL { + private get wsConnectionUrl(): URL { return this.getSupervisionUrlOcppConfiguration() ? new URL( this.getConfigurationKey(this.getSupervisionUrlOcppKey()).value + @@ -536,15 +536,6 @@ export default class ChargingStation { } } ); - // FIXME: triggered by saveConfiguration() - // if (this.getOcppPersistentConfiguration()) { - // FileUtils.watchJsonFile( - // this.logPrefix(), - // FileType.ChargingStationConfiguration, - // this.configurationFile, - // this.configuration - // ); - // } // Handle WebSocket message this.wsConnection.on( 'message', diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 6da954d1..b39665e5 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -42,7 +42,7 @@ export default class Configuration { // Read conf return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'logStatisticsInterval') ? Configuration.getConfig().logStatisticsInterval - : 60; + : Constants.DEFAULT_LOG_STATISTICS_INTERVAL; } static getUIWebSocketServer(): UIWebSocketServerConfiguration { diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 76697c8a..b115a42f 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -95,6 +95,8 @@ export default class Constants { static readonly DEFAULT_CONNECTION_TIMEOUT = 30; + static readonly DEFAULT_LOG_STATISTICS_INTERVAL = 60; // Seconds + static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000; // Ms static readonly SUPPORTED_MEASURANDS = Object.freeze([ -- 2.34.1