1) Give a description of the problem
I’m seeking guidance on the best-practices for piston design. I’m a professional Software Developer and have naturally opted to use tried and tested methodologies SOLID methods like the “Single Responsibility Principle”. and “Do not repeat yourself”
In doing this the Majority of my pistons perform a single action, without a trigger.
These Pistons are then triggered from other pistons, e.g. This is my morning alarm clock / wake up piston… When my Withing Sleep Sensor says I’m in bed (via virtual switch set by IFTTT) and the alarm switch is triggered by Smartthings automation, then the other two pistons above get executed, one to fade the lights up by a Hue Routine, and then wait 15 mins and play my wake up playlist on my Sonos…
I’ve not seen many examples of pistons being used like this and I’m concerned about things like scheduling and concurrency and what settings I should enable on the sub-pistons to ensure they work correctly.
I’ve got some questions about how “Execute Piston” works:
- Does it block and wait the calling piston until the executed sub-piston completes, including any waits
- If Execute piston is called from two separate master pistons, will the second execute piston be cancelled by the scheduler?
- What settings should I enable, e.g. Concurrency/Scheduling to ensure this approach works properly.