Remove codacy warnings from sma_webbox (#5330)
* Remove codacy warnings * try let and const in the scope instead
Chris Akritidis committed
Feb 5, 2019 at 13:25 UTC
369967f27b39d35b1d40d36b558d7ba6658e05a7
1 file changed
+7
-6
collectors/node.d.plugin/sma_webbox/sma_webbox.node.js
+7
-6
@@ -73,10 +73,11 @@ var webbox = {
73
if(found > 0 && service.added !== true)
74
service.commit();
75
76
+
77
// Grid Current Power Chart
78
if(d['GriPwr'].value !== null) {
78
- var id = 'smawebbox_' + service.name + '.current';
79
- var chart = webbox.charts[id];
79
+ const id = 'smawebbox_' + service.name + '.current';
80
+ let chart = webbox.charts[id];
81
82
if(typeof chart === 'undefined') {
83
chart = {
@@ -111,8 +112,8 @@ var webbox = {
112
}
113
114
if(d['GriEgyTdy'].value !== null) {
114
- var id = 'smawebbox_' + service.name + '.today';
115
- var chart = webbox.charts[id];
115
+ const id = 'smawebbox_' + service.name + '.today';
116
+ let chart = webbox.charts[id];
117
118
if(typeof chart === 'undefined') {
119
chart = {
@@ -147,8 +148,8 @@ var webbox = {
148
}
149
150
if(d['GriEgyTot'].value !== null) {
150
- var id = 'smawebbox_' + service.name + '.total';
151
- var chart = webbox.charts[id];
151
+ const id = 'smawebbox_' + service.name + '.total';
152
+ let chart = webbox.charts[id];
153
154
if(typeof chart === 'undefined') {
155
chart = {