Skip to content

Commit

Permalink
Also check for true/false values, not just those defined as on/off by…
Browse files Browse the repository at this point in the history
… user
  • Loading branch information
joepavitt committed Dec 22, 2023
1 parent d1caba8 commit 4ccb7c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodes/widgets/ui_switch.js
Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ module.exports = function (RED) {
datastore.save(node.id, msg)

node.status({
fill: msg.payload === on ? 'green' : 'red',
fill: (msg.payload === true || msg.payload === on) ? 'green' : 'red',
shape: 'ring',
text: msg.payload === on ? states[1] : states[0]
text: (msg.payload === true || msg.payload === on) ? states[1] : states[0]
})

if (config.passthru) {

0 comments on commit 4ccb7c9

Please sign in to comment.