A flashing node for the edit screen - requeset

Nice. We're just a bit out of sync here. I'm not sure I see the advantage of a subflow as opposed to just making copies of the function, but it's a matter of your programming style.

It certainly is visible -- not in the recommended "muted palette."

1 Like

Yeah.

Although you did explain how to do the env in a function node.....
This way it is more......
The way it is set is easier?

THANKS VERY MUCH for that.
I haven't got enough skill to do that sort of stuff really.
I do have things like that in VERY SPECIFIC parts and not often. So I didn't want to try it.

And yes the colour is there to get your eyes to see them when in/on the EDIT screen so you can delete them when done. :wink:

1 Like

I tweaked it a bit more.

[{"id":"1010fc4793a4d132","type":"subflow","name":"Debug Alert","info":"2023 03 21\n==\n\nUsed to indicate message passing this point\nin the flow.\nTHIS IS AN INDICATION ONLY!\nIt does NOT pass the message!\n\n`message` is the message flashed and maybe\nshown in the `degub` window (right side)\n`warnings` determins if the `debug` message\nis also shown.   `true` == shown.","category":"","in":[{"x":60,"y":80,"wires":[{"id":"5cc79293a6fbfc60"}]}],"out":[{"x":340,"y":80,"wires":[{"id":"5cc79293a6fbfc60","port":0}]}],"env":[{"name":"message","type":"str","value":"","ui":{"label":{"en-US":"Messages"}}},{"name":"warnings","type":"bool","value":"true","ui":{"label":{"en-US":"Warnings on/off"},"type":"input","opts":{"types":["bool"]}}}],"meta":{},"color":"#BB0000","icon":"node-red/alert.svg","status":{"x":340,"y":130,"wires":[{"id":"10226f443ccc05c3","port":0}]}},{"id":"5cc79293a6fbfc60","type":"function","z":"1010fc4793a4d132","name":"Alert","func":"//=====================================================\n//      Get variables and set things up.\nlet warnings = env.get(\"warnings\") || false;\nlet timerID;\nlet count = 6;      //  3 pulses\nlet interval = 500;      // ms\nlet sOff = {};\nlet sOn = {};\nlet message = env.get(\"message\") || \"Look at me\";\n//=====================================================\n\n//--------------------------\n//  Should warnings be sent?\nif (warnings)\n{\n    node.warn(message);\n}\n//--------------------------\n\n//--------------------------\n//  Blink message under node.\nsOn = {fill:\"red\",shape:\"dot\",text:message}\nlet s = sOn\nnode.status(s)\nchangeColor()\nreturn msg\n//--------------------------\n\n//--------------------------\n//  Functions below\n//--------------------------\nfunction changeColor() {\n    if (!timerID) {\n        timerID = setInterval(flashStatus, interval);\n    }\n}\n\nfunction flashStatus() {\n    if (--count != 0) {\n        s = s == sOff ? sOn : sOff\n        node.status(s)\n    } else {\n        clearTimeout(timerID)\n        timerID = null\n    }\n}\n//--------------------------","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":190,"y":80,"wires":[[]]},{"id":"10226f443ccc05c3","type":"status","z":"1010fc4793a4d132","name":"","scope":null,"x":200,"y":130,"wires":[[]]},{"id":"43cfa2f75dac4787","type":"subflow:1010fc4793a4d132","z":"aaa025a7d2bb5b14","name":"","env":[{"name":"message","value":"DING","type":"str"},{"name":"warnings","value":"false","type":"bool"},{"name":"Pulses","value":"6","type":"num"}],"x":3490,"y":590,"wires":[[]]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.