I want to change the color and the lable text based on the input "on" and "off".
The color change works but not the lable change.
What is the problem?
let state = msg.payload.state;
msg.ui_update = {}
if (state === "ON") {
msg.ui_update.label = "EGWZ-TV ON";
node.send(msg);
msg.ui_update.textColor = "red";
return msg;
};
if (state === "OFF"){
msg.ui_update.lable = "EGWZ-TV OFF";
node.send(msg);
msg.ui_update.textColor = "white";
return msg;
};
jbudd
2
You have a typo in the if(state === "OFF")
block (and this post title), lable
should be label
.
Hi Budd,
thanks for the quick response!
I changed lable but it still does not change the text.
msg.ui_update = {};
node.warn(msg.payload.state)
if (msg.payload.state === "ON") {
msg.ui_update.textColor = "red";
node.send(msg);
msg.ui_update.lable = "EGWZ-TV ON";
return msg;
};
if (msg.payload.state === "OFF"){
msg.ui_update.textColor = "white";
node.send(msg);
msg.ui_update.lable = "EGWZ-TV OFF";
return msg;
};