I have a question on the flowchart at:
http://wiki.micasaverde.com/index.php/Luup_Scenes_Events
I’m trying to clarify when the Luup gets executed in a scene. We can put our Luup code attached to a trigger, or attached to the Luup tab for a scene.
We attach some Luup code to a trigger. The Luup code gets executed when the trigger goes off. If the Luup returns true, then the Luup code in the scene tab would get executed if there was code there. If the Luup code in the trigger returns false, the entire scene is aborted, even if there are other triggers that return true (this is the part that is not clear. When I see ABORT in the flow chart, I take that to mean the ENTIRE scene is aborted if ANY trigger Luup returns false)
If Luup code in the Luup tab returns true, the actions in the device tab get executed, otherwise, the entire scene is aborted.
Is my understanding correct?
Yes, but only ONE trigger is evaluated … the one that is trying to kick the scene into action.
But if you look at that flowchart, you can have more than one trigger kicking the scene in. Usually, if you have an OR, any trigger should work. But the fact they have that “ABORT” on some triggers would indicate you will never get to that OR if ANY trigger aborts.
I think reading this thread:
http://forum.micasaverde.com/index.php/topic,18679.0.html
It looks like the ABORT for the triggers does not completely abort the entire scene but simply THAT trigger. If this is so, it might be clearer to change this in the flowchart to simply have the trigger report “FALSE” if the LUUP reports false which seems to be what it does.
This is an Event based flow chart … not an analysis of the current state of all the inputs.
Some Event causes you to enter the flow chart on the left.
It does NOT look at or evaluate the other triggers or schedules.
If a Timer starts the process … no Triggers are checked, or other schedules. It just proceeds to check the Scene Level LUA code/predicate.
Any Event N Trigger that does not have tirigger level LUA code that returns Abort … continues to check the Scene Level LUA code/predicate.
The fact that all of these events are done independent of the others is the basis for the OR of the inputs.
Thank you Richard. That clarifies the flowchart well.
Mark