File tree Expand file tree Collapse file tree 6 files changed +13
-15
lines changed
homemon-server/public/javascripts Expand file tree Collapse file tree 6 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ socket.on('data', function(data) {
1717
1818 // itertate through table to find out where to insert row in alpha order
1919 var count = 1 ;
20- if ( document . getElementById ( "messagetable" ) . rows . length != 1 ) {
20+ if ( document . getElementById ( "messagetable" ) . rows . length !== 1 ) {
2121 for ( i = 1 ; i < document . getElementById ( "messagetable" ) . rows . length ; i ++ ) {
2222 var row = table . rows [ i ] ;
2323 var col = row . cells [ 0 ] ;
@@ -30,7 +30,7 @@ socket.on('data', function(data) {
3030 var row = table . insertRow ( count ) ;
3131 var cell = row . insertCell ( 0 ) ;
3232 cell . id = data . topic ;
33- var cell = row . insertCell ( 0 ) ;
33+ cell = row . insertCell ( 0 ) ;
3434 cell . id = data . topic + "name" ;
3535 document . getElementById ( data . topic ) . style . textAlign = "right"
3636 document . getElementById ( data . topic ) . style . wordWrap = "normal"
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ BeginsWith = function(needle, haystack) {
55 return ( haystack . substr ( 0 , needle . length ) == needle ) ;
66}
77
8- var myvalues = [ ] ;
98var updates = 0 ;
109
1110var socket = io . connect ( "http://homemon.trease.eu:8500/" ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ElementExists = function(id) {
22 return ! ! document . getElementById ( id ) ;
33} ;
44BeginsWith = function ( needle , haystack ) {
5- return ( haystack . substr ( 0 , needle . length ) == needle ) ;
5+ return ( haystack . substr ( 0 , needle . length ) === needle ) ;
66}
77
88// Load the Visualization API and the piechart package.
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ String.prototype.beginsWith = function (string) {
88} ;
99
1010
11- var myvalues = [ ] ;
1211var updates = 0 ;
1312
1413
@@ -48,7 +47,7 @@ socket.on("data", function(data) {
4847 var row = table . insertRow ( table . rows . length ) ;
4948 var cell = row . insertCell ( 0 ) ;
5049 cell . id = data . topic ;
51- var cell = row . insertCell ( 0 ) ;
50+ cell = row . insertCell ( 0 ) ;
5251 cell . id = data . topic + "name" ;
5352
5453 document . getElementById ( data . topic ) . style . textAlign = "right" ;
Original file line number Diff line number Diff line change @@ -30,22 +30,22 @@ socket.on("data", function(data) {
3030 var cell = row . insertCell ( 0 ) ;
3131 cell . id = "sensors/co2/" + device ;
3232
33- var cell = row . insertCell ( 0 ) ;
33+ cell = row . insertCell ( 0 ) ;
3434 cell . id = "sensors/co/" + device ;
3535
36- var cell = row . insertCell ( 0 ) ;
36+ cell = row . insertCell ( 0 ) ;
3737 cell . id = "sensors/no2/" + device ;
3838
39- var cell = row . insertCell ( 0 ) ;
39+ cell = row . insertCell ( 0 ) ;
4040 cell . id = "sensors/humidity/" + device ;
4141
42- var cell = row . insertCell ( 0 ) ;
42+ cell = row . insertCell ( 0 ) ;
4343 cell . id = "sensors/pressure/" + device ;
4444
45- var cell = row . insertCell ( 0 ) ;
45+ cell = row . insertCell ( 0 ) ;
4646 cell . id = "sensors/temperature/" + device ;
4747
48- var cell = row . insertCell ( 0 ) ;
48+ cell = row . insertCell ( 0 ) ;
4949 cell . id = device + "name" ;
5050
5151
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ mqttclient.on("connect", function() {
7878 if ( recordsDaily [ topic ] == undefined ) {
7979 recordsDaily [ topic ] = 0 ;
8080 }
81- if ( recordsLastValue [ topic ] == undefined ) {
81+ if ( recordsLastValue [ topic ] === undefined ) {
8282 recordsLastValue [ topic ] = 0 ;
8383 }
8484
@@ -166,11 +166,11 @@ mqttclient.on("connect", function() {
166166 }
167167
168168 // each time we get power/0 caculate then publish the "unknown power draw" and publish to power/U
169- if ( topic == "sensors/power/0" ) {
169+ if ( topic === "sensors/power/0" ) {
170170 var known = 0 ;
171171 for ( var key in recordsLastValue ) {
172172 // only it it matches sensors/power/[0-9]
173- if ( key . length == 15 && key != "sensors/power/0" && key != "sensors/power/U" ) {
173+ if ( key . length === 15 && key != "sensors/power/0" && key != "sensors/power/U" ) {
174174 // console.log(key, known, recordsLastValue[key]);
175175 known += recordsLastValue [ key ] ;
176176 }
You can’t perform that action at this time.
0 commit comments