Code:
val procedure = [ String varLamp|
if varLamp == "test_1") {
sendCommand(ZigbeeLamp1, ON)
Thread::sleep(5000)
sendCommand(ZigbeeLamp1, OFF)
}
if varLamp == "test_2") {
sendCommand(ZigbeeLamp2, ON)
Thread::sleep(5000)
sendCommand(ZigbeeLamp2, OFF)
}
if varLamp == "test_3") {
sendCommand(ZigbeeLamp3, ON)
Thread::sleep(5000)
sendCommand(ZigbeeLamp3, OFF)
}
]
//---------------------------------------------------
rule "Button One"
when
Item Switch received update
then
val variable_lamp1 = procedure.apply("test_1")
val variable_lamp2 = procedure.apply("test_2")
val variable_lamp3 = procedure.apply("test_3")
end
I am looking for help. In the example above, each procedure is performed after the previous one has finished. Llamas light up one at a time. How to perform the next procedure without waiting for the end of the previous one? Thanks