From a6fdaef228f561c54e1ed379d596bdf4daf620f9 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Mon, 29 Apr 2024 20:17:18 +0200 Subject: [PATCH] appease eslint --- webapp/src/components/VedirectView.vue | 4 +-- webapp/src/views/PowerLimiterAdminView.vue | 32 +++++++++++----------- webapp/src/views/PowerMeterAdminView.vue | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/webapp/src/components/VedirectView.vue b/webapp/src/components/VedirectView.vue index e79b265fe..a1ed9bc3c 100644 --- a/webapp/src/components/VedirectView.vue +++ b/webapp/src/components/VedirectView.vue @@ -164,7 +164,7 @@ export default defineComponent({ this.socket.onmessage = (event) => { console.log(event); - var root = JSON.parse(event.data); + const root = JSON.parse(event.data); this.dplData = root["dpl"]; if (root["vedirect"]["full_update"] === true) { this.vedirect = root["vedirect"]; @@ -192,7 +192,7 @@ export default defineComponent({ clearTimeout(this.dataAgeTimers[serial]); } - var nextMs = 1000 - (this.vedirect.instances[serial].data_age_ms % 1000); + const nextMs = 1000 - (this.vedirect.instances[serial].data_age_ms % 1000); this.dataAgeTimers[serial] = setTimeout(() => { this.doDataAging(serial); }, nextMs); diff --git a/webapp/src/views/PowerLimiterAdminView.vue b/webapp/src/views/PowerLimiterAdminView.vue index fec3f4ff8..500614c6c 100644 --- a/webapp/src/views/PowerLimiterAdminView.vue +++ b/webapp/src/views/PowerLimiterAdminView.vue @@ -244,8 +244,8 @@ export default defineComponent({ }, watch: { 'powerLimiterConfigList.inverter_serial'(newVal) { - var cfg = this.powerLimiterConfigList; - var meta = this.powerLimiterMetaData; + const cfg = this.powerLimiterConfigList; + const meta = this.powerLimiterMetaData; if (newVal === "") { return; } // do not try to convert the placeholder value @@ -271,9 +271,9 @@ export default defineComponent({ }, methods: { getConfigHints() { - var cfg = this.powerLimiterConfigList; - var meta = this.powerLimiterMetaData; - var hints = []; + const cfg = this.powerLimiterConfigList; + const meta = this.powerLimiterMetaData; + const hints = []; if (meta.power_meter_enabled !== true) { hints.push({severity: "optional", subject: "PowerMeterDisabled"}); @@ -284,7 +284,7 @@ export default defineComponent({ this.configAlert = true; } else { - var inv = meta.inverters[cfg.inverter_serial]; + const inv = meta.inverters[cfg.inverter_serial]; if (inv !== undefined && !(inv.poll_enable && inv.command_enable && inv.poll_enable_night && inv.command_enable_night)) { hints.push({severity: "requirement", subject: "InverterCommunication"}); } @@ -309,19 +309,19 @@ export default defineComponent({ return this.powerLimiterMetaData.power_meter_enabled; }, canUseSolarPassthrough() { - var cfg = this.powerLimiterConfigList; - var meta = this.powerLimiterMetaData; - var canUse = this.isEnabled() && meta.charge_controller_enabled && !cfg.is_inverter_solar_powered; + const cfg = this.powerLimiterConfigList; + const meta = this.powerLimiterMetaData; + const canUse = this.isEnabled() && meta.charge_controller_enabled && !cfg.is_inverter_solar_powered; if (!canUse) { cfg.solar_passthrough_enabled = false; } return canUse; }, canUseSoCThresholds() { - var cfg = this.powerLimiterConfigList; - var meta = this.powerLimiterMetaData; + const cfg = this.powerLimiterConfigList; + const meta = this.powerLimiterMetaData; return this.isEnabled() && meta.battery_enabled && !cfg.is_inverter_solar_powered; }, canUseVoltageThresholds() { - var cfg = this.powerLimiterConfigList; + const cfg = this.powerLimiterConfigList; return this.isEnabled() && !cfg.is_inverter_solar_powered; }, isSolarPassthroughEnabled() { @@ -331,10 +331,10 @@ export default defineComponent({ return Array.from(Array(end).keys()); }, needsChannelSelection() { - var cfg = this.powerLimiterConfigList; - var meta = this.powerLimiterMetaData; + const cfg = this.powerLimiterConfigList; + const meta = this.powerLimiterMetaData; - var reset = function() { + const reset = function() { cfg.inverter_channel_id = 0; return false; }; @@ -343,7 +343,7 @@ export default defineComponent({ if (cfg.is_inverter_solar_powered) { return reset(); } - var inverter = meta.inverters[cfg.inverter_serial]; + const inverter = meta.inverters[cfg.inverter_serial]; if (inverter === undefined) { return reset(); } if (cfg.inverter_channel_id >= inverter.channels) { diff --git a/webapp/src/views/PowerMeterAdminView.vue b/webapp/src/views/PowerMeterAdminView.vue index 4bc9e76c3..8371d4651 100644 --- a/webapp/src/views/PowerMeterAdminView.vue +++ b/webapp/src/views/PowerMeterAdminView.vue @@ -281,7 +281,7 @@ export default defineComponent({ this.powerMeterConfigList = data; this.dataLoading = false; - for (var i = 0; i < this.powerMeterConfigList.http_phases.length; i++) { + for (let i = 0; i < this.powerMeterConfigList.http_phases.length; i++) { this.testHttpRequestAlert.push({ message: "", type: "", @@ -312,7 +312,7 @@ export default defineComponent({ ); }, testHttpRequest(index: number) { - var phaseConfig:PowerMeterHttpPhaseConfig; + let phaseConfig:PowerMeterHttpPhaseConfig; if (this.powerMeterConfigList.http_individual_requests) { phaseConfig = this.powerMeterConfigList.http_phases[index];