Skip to content

Commit

Permalink
Merge pull request #90 from Chrischi-/master
Browse files Browse the repository at this point in the history
 Fix "ReferenceError: states is not defined" @  updateStatusIcon()
  • Loading branch information
Caprico85 authored Jan 11, 2021
2 parents bfb8bdb + 72e639d commit 12fa813
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions devices/sensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ module.exports = function(RED) {
updateStatusIcon() {
let txt = "";
if (this.states.temperatureAmbientCelsius !== undefined)
txt += states.temperatureAmbientCelsius + "\xB0C ";
txt += this.states.temperatureAmbientCelsius + "\xB0C ";

if (states.humidityAmbientPercent !== undefined)
txt += states.humidityAmbientPercent + "% ";
if (this.states.humidityAmbientPercent !== undefined)
txt += this.states.humidityAmbientPercent + "% ";

this.status({fill: "green", shape: "dot", text: txt});
}
Expand Down
2 changes: 1 addition & 1 deletion devices/shutter.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = function(RED) {
if (this.states.openPercent === 0) {
this.status({fill: "green", shape: "dot", text: "CLOSED"});
} else {
this.status({fill: "red", shape: "dot", text: util.format("OPEN %d%%", states.openPercent)});
this.status({fill: "red", shape: "dot", text: util.format("OPEN %d%%", this.states.openPercent)});
}
}

Expand Down
2 changes: 1 addition & 1 deletion devices/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = function(RED) {
if (this.states.openPercent === 0) {
this.status({fill: "green", shape: "dot", text: "CLOSED"});
} else {
this.status({fill: "red", shape: "dot", text: util.format("OPEN %d%%", states.openPercent)});
this.status({fill: "red", shape: "dot", text: util.format("OPEN %d%%", this.states.openPercent)});
}
}

Expand Down

0 comments on commit 12fa813

Please sign in to comment.