2024 Jan 22, 06:32 AM
(2024 Jan 21, 04:17 PM)dan Wrote:(2024 Jan 20, 10:15 PM)cdesouza Wrote: Instead of a program attribute I would use MM:SS and trigger the station to run once for this. Would this be a sensible way to go and would the node_red.run_once be the correct code to do this? Can I add from node_red import run_once in my plugin?Because node_red is a plugin it is not guaranteed to exist on all SIP installations. It would probably be best to copy the code in to your program.
Dan
I found two implementations of Run Once, one in the node_red plugin and the other in webpages.py. They are slightly different. If I copy the cope I would be creating a third one.
Would it not be better to consolidate the code in a helper function?