20.04.2022, 07:22
Hi,
In the above script created by admin I would like to control scenes sequence (order and delay) between scenes for the same G.A. instance like below.
Is it possible to implement this with 'os.sleep' function as below?
Is there any way I could control scene sequence (order and delay) when multiple scenes should run with same command.
Thanks in advance!
In the above script created by admin I would like to control scenes sequence (order and delay) between scenes for the same G.A. instance like below.
Is it possible to implement this with 'os.sleep' function as below?
Is there any way I could control scene sequence (order and delay) when multiple scenes should run with same command.
Thanks in advance!
Code:
-- ΣΚΗΝΗ @H - H - Leave Home for a while
['20/1/130'] = {
timeout = 0.5,
longpress = 5,
press = function(ptype, count)
if ptype == 'short' then
if count == 1 then
scene.run('@H - R1 - Leave Home for a while - Lights')
scene.run('@H - R2 - Leave Home for a while - Lights')
scene.run('@H - R3 - Leave Home for a while - Lights')
scene.run('@H - R4 - Leave Home for a while - Lights')
scene.run('@H - R5 - Leave Home for a while - Lights')
scene.run('@H - R6 - Leave Home for a while - Lights')
os.sleep(0.2)
scene.run('@H - G_LR/DR/KTC/COR - Leave Home for a while - Lights')
scene.run('@H - B1_LR - Leave Home for a while - Lights')
scene.run('@H - F1_COR - Leave Home for a while - Lights')
scene.run('@H - LDR/RF - Leave Home for a while - Lights')
--scene.run('@H - H - Leave Home for a while - Outside Lights')
elseif count == 2 then
scene.run('@H - R1 - Leave Home for a while - Lights')
scene.run('@H - R2 - Leave Home for a while - Lights')
scene.run('@H - R3 - Leave Home for a while - Lights')
scene.run('@H - R4 - Leave Home for a while - Lights')
scene.run('@H - R5 - Leave Home for a while - Lights')
scene.run('@H - R6 - Leave Home for a while - Lights')
scene.run('@H - G_LR/DR/KTC/COR - Leave Home for a while - Lights')
scene.run('@H - B1_LR - Leave Home for a while - Lights')
scene.run('@H - F1_COR - Leave Home for a while - Lights')
scene.run('@H - LDR/RF - Leave Home for a while - Lights')
--scene.run('@H - H - Leave Home for a while - Outside Lights')
scene.run('@H - H - Leave Home for a while - Curtains')
end
elseif ptype == 'long' then
scene.savelive('@H - R1 - Leave Home for a while - Lights')
scene.savelive('@H - R2 - Leave Home for a while - Lights')
scene.savelive('@H - R3 - Leave Home for a while - Lights')
scene.savelive('@H - R4 - Leave Home for a while - Lights')
scene.savelive('@H - R5 - Leave Home for a while - Lights')
scene.savelive('@H - R6 - Leave Home for a while - Lights')
scene.savelive('@H - G_LR/DR/KTC/COR - Leave Home for a while - Lights')
scene.savelive('@H - B1_LR - Leave Home for a while - Lights')
scene.savelive('@H - F1_COR - Leave Home for a while - Lights')
scene.savelive('@H - LDR/RF - Leave Home for a while - Lights')
--scene.savelive('@H - H - Leave Home for a while - Outside Lights')
scene.savelive('@H - H - Leave Home for a while - Curtains')
end
end
},