Skip to content

Commit

Permalink
appease eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Apr 29, 2024
1 parent 84e83f2 commit d3b306e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions webapp/src/components/VedirectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down Expand Up @@ -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);
Expand Down
32 changes: 16 additions & 16 deletions webapp/src/views/PowerLimiterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"});
Expand All @@ -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"});
}
Expand All @@ -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() {
Expand All @@ -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;
};
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/views/PowerMeterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit d3b306e

Please sign in to comment.