Trying to simplify before expanding


#1

1) Give a description of the problem
I want to simplify my piston before expanding. Is there a way to pair up devices or do a device list for triggers but return the enumeration to reference the next device list for action?

2) What is the expected behaviour?
I have the remotes for two lamps. One for one.

3) What is happening/not happening?
It works. I just want to simplify the piston

4) Post a Green Snapshot of the piston!


#2

Not sure if it really simplifies but you could try something like this:

device deiceList=[Device 6, Device 8]
device switchList=[Switch 1, Switch 2]
device currentSwitch

if any of deviceList gets pushed
  set variable currentSwitch=arrayItem(indexOf(deviceList,$currentEventDevice),switchList)
  if $currentEventDevice pushed gets 3
  then
     with currentSwitch
        toggle level between 0 and 25%
     end with
  end if
  if $currentEventDevice pushed gets 4
  then
     with currentSwitch
        toggle level between 0 and 99%
     end with
  end if
end if