Linter fixes
This commit is contained in:
@ -6,7 +6,8 @@
|
|||||||
"radix": [2, "as-needed"],
|
"radix": [2, "as-needed"],
|
||||||
"no-console": 0,
|
"no-console": 0,
|
||||||
"linebreak-style": "off",
|
"linebreak-style": "off",
|
||||||
"prettier/prettier": 0
|
"prettier/prettier": 0,
|
||||||
|
"quotes": ["error", "single"]
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"import/core-modules": [ "node_helper" ]
|
"import/core-modules": [ "node_helper" ]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
let poolData = {};
|
let poolData = {};
|
||||||
let moduleObj;
|
let moduleObj;
|
||||||
|
|
||||||
Module.register("MMM-ScreenLogic",{
|
Module.register('MMM-ScreenLogic',{
|
||||||
defaults: {
|
defaults: {
|
||||||
showPoolTemp: true,
|
showPoolTemp: true,
|
||||||
showSpaTemp: true,
|
showSpaTemp: true,
|
||||||
@ -16,7 +16,7 @@ Module.register("MMM-ScreenLogic",{
|
|||||||
coldTemp: 84,
|
coldTemp: 84,
|
||||||
hotTemp: 90,
|
hotTemp: 90,
|
||||||
columns: 3,
|
columns: 3,
|
||||||
contentClass: "light",
|
contentClass: 'light',
|
||||||
updateInterval: 30 * 60 * 1000
|
updateInterval: 30 * 60 * 1000
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -33,77 +33,77 @@ Module.register("MMM-ScreenLogic",{
|
|||||||
},
|
},
|
||||||
|
|
||||||
getStyles: function() {
|
getStyles: function() {
|
||||||
return ["screenlogic.css"];
|
return ['screenlogic.css'];
|
||||||
},
|
},
|
||||||
|
|
||||||
getDom: function() {
|
getDom: function() {
|
||||||
if (!poolData.status) {
|
if (!poolData.status) {
|
||||||
let wrapper = document.createElement("div");
|
let wrapper = document.createElement('div');
|
||||||
wrapper.innerHTML = 'Loading...';
|
wrapper.innerHTML = 'Loading...';
|
||||||
wrapper.className += "dimmed light small";
|
wrapper.className += 'dimmed light small';
|
||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
} else {
|
} else {
|
||||||
let table = document.createElement('table');
|
let table = document.createElement('table');
|
||||||
table.className = "small";
|
table.className = 'small';
|
||||||
if (this.config.colored) {
|
if (this.config.colored) {
|
||||||
table.className += " colored";
|
table.className += ' colored';
|
||||||
}
|
}
|
||||||
|
|
||||||
let contents = [];
|
let contents = [];
|
||||||
|
|
||||||
if (this.config.showPoolTemp) {
|
if (this.config.showPoolTemp) {
|
||||||
let className = "";
|
let className = '';
|
||||||
if (poolData.status.currentTemp[0] <= this.config.coldTemp) {
|
if (poolData.status.currentTemp[0] <= this.config.coldTemp) {
|
||||||
className += " cold-temp";
|
className += ' cold-temp';
|
||||||
} else if (poolData.status.currentTemp[0] >= this.config.hotTemp) {
|
} else if (poolData.status.currentTemp[0] >= this.config.hotTemp) {
|
||||||
className += " hot-temp";
|
className += ' hot-temp';
|
||||||
}
|
}
|
||||||
|
|
||||||
contents.push({
|
contents.push({
|
||||||
header: "Pool temp",
|
header: 'Pool temp',
|
||||||
data: poolData.status.currentTemp[0] + "°" + (!isPoolActive(poolData.status) ? " (last)" : ""),
|
data: poolData.status.currentTemp[0] + '°' + (!isPoolActive(poolData.status) ? ' (last)' : ''),
|
||||||
class: this.config.contentClass + className
|
class: this.config.contentClass + className
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.config.showSpaTemp) {
|
if (this.config.showSpaTemp) {
|
||||||
let className = "";
|
let className = '';
|
||||||
if (poolData.status.currentTemp[1] <= this.config.coldTemp) {
|
if (poolData.status.currentTemp[1] <= this.config.coldTemp) {
|
||||||
className = " cold-temp";
|
className = ' cold-temp';
|
||||||
} else if (poolData.status.currentTemp[1] >= this.config.hotTemp) {
|
} else if (poolData.status.currentTemp[1] >= this.config.hotTemp) {
|
||||||
className = " hot-temp";
|
className = ' hot-temp';
|
||||||
}
|
}
|
||||||
|
|
||||||
contents.push({
|
contents.push({
|
||||||
header: "Spa temp",
|
header: 'Spa temp',
|
||||||
data: poolData.status.currentTemp[1] + "°" + (!isSpaActive(poolData.status) ? " (last)" : ""),
|
data: poolData.status.currentTemp[1] + '°' + (!isSpaActive(poolData.status) ? ' (last)' : ''),
|
||||||
class: this.config.contentClass + className
|
class: this.config.contentClass + className
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.config.showPH) {
|
if (this.config.showPH) {
|
||||||
contents.push({
|
contents.push({
|
||||||
header: "pH",
|
header: 'pH',
|
||||||
data: poolData.status.pH,
|
data: poolData.status.pH,
|
||||||
class: this.config.contentClass
|
class: this.config.contentClass
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.config.showOrp) {
|
if (this.config.showOrp) {
|
||||||
contents.push({
|
contents.push({
|
||||||
header: "ORP",
|
header: 'ORP',
|
||||||
data: poolData.status.orp,
|
data: poolData.status.orp,
|
||||||
class: this.config.contentClass
|
class: this.config.contentClass
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.config.showSaltLevel) {
|
if (this.config.showSaltLevel) {
|
||||||
contents.push({
|
contents.push({
|
||||||
header: "Salt PPM",
|
header: 'Salt PPM',
|
||||||
data: poolData.status.saltPPM,
|
data: poolData.status.saltPPM,
|
||||||
class: this.config.contentClass
|
class: this.config.contentClass
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.config.showSaturation) {
|
if (this.config.showSaturation) {
|
||||||
contents.push({
|
contents.push({
|
||||||
header: "Saturation",
|
header: 'Saturation',
|
||||||
data: poolData.status.saturation,
|
data: poolData.status.saturation,
|
||||||
class: this.config.contentClass
|
class: this.config.contentClass
|
||||||
});
|
});
|
||||||
|
@ -58,7 +58,7 @@ module.exports = NodeHelper.create({
|
|||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
self.timer = setInterval(function() {
|
self.timer = setInterval(function() {
|
||||||
self.doUpdate()
|
self.doUpdate();
|
||||||
}, self.updateInterval);
|
}, self.updateInterval);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user