Okay. I have downloaded your snippet. I have also downloaded the Yamaha example panel so I can see what exactly is going on in updateChannelOn.
In order to fix this, I need to know exactly what you're trying to do.
Are you trying to attach a GPI Trigger to each of the channel buttons?
So
GPI 1:0 would turn channel 1 off
GPI 1:1 would turn channel 1 on
GPI 2:0 would turn channel 2 off
GPI 2:1 would turn channel 2 on
...
OR
Are you trying to simply toggle any button's state
So
GPI 1:1 would turn channel 1 OFF if it is already ON or ON if it is already off
GPI 1:2 would turn channel 2 OFF if it is already ON or ON if it is already off
GPI 1:3 would turn channel 3 OFF if it is already ON or ON if it is already off
...
Once you clarify this, I believe I can get your panel sorted out.
#DashBoard