Multi-threaded piston


#1

Hello, I am trying to write a piston that will review a variety of switches and if there is a change take an action on that device. I know I could write multiple pistons, one for each device…if device A changes, do action 1 on device A. However, I feel, buried within the various piston configurations is a way to code it more like this…if device A, B or C changes, do action 1 on device that changed (not all devices).

Any help please?


#2

Use $currentEventDevice. For example

On events from Any of LightA’s, LightB’s, or Light C’s switch
with $currentEventDevice
do stuff
end with