Hi All,
Hoping someone might be able to let me know what i am doing wrong in the below. I have a TV which i control exclusively through a tablet / PC controller. When the device is turned ON, it changes the Virtual Device (Power On) to ON (T7), and when the power is turned off to the TV it turns the Virtual Device to OFF.
What i would like to do, is to be able to hit a button on the HSTOUCH screen which determines what channel the TV needs to be set to, that part works well, but now instead of having to turn the TV on, i would like it to be able to turn the TV on, if it is already off, and then wait 15 seconds (the TV takes a while to start up) and then send the IR command to change the channel.
I was hoping the code below would let me run an if statement which would wait, and then if the statement is not true, or if it finishes it would continue within the case and do the other things, for example if power is on it would skip the turn on power and wait, and just do the IR signals, but if power is off, it would turn it on, wait and then do the IR signals.
Is there any way i can do that similar to my code below, the reason i want to avoid copying the IR code in an if, else statement is that there is around 35 - 40 different cases, so it would be easier if there was some way it would continue on, but it does not seem like it will.
Hoping someone might be able to let me know what i am doing wrong in the below. I have a TV which i control exclusively through a tablet / PC controller. When the device is turned ON, it changes the Virtual Device (Power On) to ON (T7), and when the power is turned off to the TV it turns the Virtual Device to OFF.
What i would like to do, is to be able to hit a button on the HSTOUCH screen which determines what channel the TV needs to be set to, that part works well, but now instead of having to turn the TV on, i would like it to be able to turn the TV on, if it is already off, and then wait 15 seconds (the TV takes a while to start up) and then send the IR command to change the channel.
I was hoping the code below would let me run an if statement which would wait, and then if the statement is not true, or if it finishes it would continue within the case and do the other things, for example if power is on it would skip the turn on power and wait, and just do the IR signals, but if power is off, it would turn it on, wait and then do the IR signals.
Is there any way i can do that similar to my code below, the reason i want to avoid copying the IR code in an if, else statement is that there is around 35 - 40 different cases, so it would be easier if there was some way it would continue on, but it does not seem like it will.
Code:
Case 1 'ONE if hs.DeviceValue("T7") = 2 then hs.triggerevent("POWER ON") hs.WaitSecs(15) end if hs.writelog("AV Controller","ONE") hs.sendIR("BAUHN,1,,") hs.sendIR("BAUHN,OK")
Comment