-->
Page 1 of 1

Good program scripting

PostPosted: Sun Sep 29, 2019 5:46 am
by faramon
Greeting,
i guess the answers will be different ...
How to write a good program with init.lua and program.lua so that the settings are configured in init and in the program that everything goes in a loop? Is that a good approach? I would put checks in the loop:
1. Is the internet still accessible
2. Is the mqtt server available
If either of these conditions breaks, have the program back within that loop re-check the internet and if the internet is available, check the mqtt connection and if so go on.
Does anyone do this approach?
So far I have worked in multiple scripts, modularly, but I suppose it is enough to have init and a script program.
What is your opinion on this?