The wait command is confusing me


#1

1) Give a description of the problem
I’m trying to make a system that knows what color tenmperature and brightness it should be at all times. so that when i turn it on it automatically goes to the right settings and i dont have to yell at google anymore.
Now here comes the problem, when i put it all together (instead of separate pistons) it will get “stuck” on the ‘wait’ command.

2) What is the expected behavior?
it should just all work at the same time instead of waiting for the first bit to finish.

**3) What is happening/not happening? **
It waits at the wait command and doesn’t run simultaneously

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

It can be important to realise that nothing quite runs simultaneously. The async directive on a block means that when it reaches a wait the current instance of the piston will move on to the next action rather than exiting (I’ve never looked to see what happens with short waits that aren’t normally implemented with an exit and wake-up).

I’ve never really got my head around what it does on conditionals like if, while and repeat and I don’t actually know what to expect when async blocks are nested in the way you have them, with async inside async inside async. It gets rather hard to follow the flow. Which wait does it hold at that you don’t think it should? Do you really need async in so many places?