I'm using python to detect two colors "red" and "green", and display them on the node red UI in the form of a text and a led, if i detect green a text green will be written and the led is lit green, but when i terminate the color detection code, the text and led are still green.
i have a function before the text and led to discriminate between red and green:
var Color = msg.payload
if (Color === "Red") {
return msg;
}
else if (Color === "Green") {
return msg;
}