15 lines
506 B
JavaScript
15 lines
506 B
JavaScript
if (msg.lights === 'on') {
|
|
if (msg.room === 'Kallen Bedroom') {
|
|
node.status({fill:"green",shape:"dot",text:"Lights Controlled"})
|
|
return[msg,null]
|
|
} else if (msg.room === 'Living Room') {
|
|
node.status({fill:"green",shape:"dot",text:"Lights Controlled"})
|
|
return[null,msg]
|
|
} else {
|
|
node.status({fill:"red",shape:"ring",text:`N/A in ${msg.room}`})
|
|
return null
|
|
}
|
|
} else {
|
|
node.status({fill:"red",shape:"ring",text:"Disabled"})
|
|
return null
|
|
} |