Hey Guys,
Could use some assistance.
I have a function in node-red that is dimming some lights.
We are taking the current brightness and reducing it by 25% of the total brightness on each function run. This would great as expected.
However, if the returned value is less then 1 it turns the lights off which we would like to prevent.
I am wondering if someone can help me out with a statement that
IF value is < 1 then the value = 1 (This would get the brightness to = 1 vs turning it off)
newmsg = {};
brightness = msg.data.attributes.brightness - 64
newmsg.payload = { data: {"brightness":brightness} };
return newmsg;