I have reusable code for day/night scene which controls blinds. This scene doesn't run immediately but continues for e.g. 5 minutes, it depends on which zones are switched on and other conditions.
Above scenes are running by sun event and also by a user which can sent it one by one but the most important is the last and before it starts it should cancel all old instances.
Perfect solution would be:
I think that possible option is also adding additional GA which would storage the newest event pid and in event I can check before every step if that event has same pid.
But this will add another unnecessary requests to DB, and adding unnecessary GA to project is also not good.
I think this is missed in events mechanism which is great. There is a possibility to not run new event which is currently running but there is no in same elegant way tell to LM that it should run only the newest instance.
But your mechanism is very, very good and in comparison to e.g. eibPort it is nice that in your solution there is no time limit for script.
Above scenes are running by sun event and also by a user which can sent it one by one but the most important is the last and before it starts it should cancel all old instances.
Perfect solution would be:
Code:
-- event start
cancelOldInstances()
day = event.getvalue()
if day then scenes.day() else scenes.night() end
I think that possible option is also adding additional GA which would storage the newest event pid and in event I can check before every step if that event has same pid.
But this will add another unnecessary requests to DB, and adding unnecessary GA to project is also not good.
I think this is missed in events mechanism which is great. There is a possibility to not run new event which is currently running but there is no in same elegant way tell to LM that it should run only the newest instance.
But your mechanism is very, very good and in comparison to e.g. eibPort it is nice that in your solution there is no time limit for script.
Done is better than perfect