Switching device by variable

I understand how this is done, but what happens when a button has a command that doesn't exist for the new device?

The commands are switched by name, so as long as there is a command in the new device, with the same command name as set for the button, it will now send that command for the new device. But if there is no such command, what happens with that button? All the other buttons have swapped OK, but this one now has no command to send. What happens?

Is there an error generated at run time when the device is switched?

Is there an error generated when you press the button?

What about the appearance of the button? Normally a button with no command is greyed out, but in this case, it has a command assigned that doesn't exist in the now specified device. So is the button greyed out and disabled, or can you still tap it, but nothing happens?
1 person has
this question
+1
Reply
  • I would try it and see. If nothing else just create a dummy command with that name and you should be good or copy the command you would like it to be and rename it to that button. You can have multiple commands that are the same with just a different name. Just remember they need to be the same type I believe. As far as generating errors I would say no.Anytime you program a feature like this in software you usually allow for these problems and code appropriately for them. From what I have seen the developers of Irule do not include functions that are not thorough and complete.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Ken,

    If the commands have different names and are not swapped via variable the existing device will still show on that button. The command will still control the previous device if the commands are not swapped. You can verify this by tapping the gateway beacon on the page you are swapping commands. You will notice both devices in the list of controlled devices on the page.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Here's another scenario. What happens to the buttons containing commands for a device that is then deleted? Would I be right in thinking that nothing changes, except that no command is actually sent. But the button will still think it has a command attached as it holds the device ID and command name, even though neither actually exist any longer?

    What about when just the command is deleted? So the device still exists, but not the command attached to the button?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Another question occurs to me.

    When swapping a device in a Panel, the HEX and Database command types (I know, they're both IR HEX codes) are swapped interchangeably. So if the 2 devices contain the same command, but one is HEX type and the other is Database type, they will still be swapped. But...

    What happens if the 'incoming' device has the same command name in both sections. Does it look for match of the same type first, then look in the other type sections?

    Will it match e.g. a HEX code with a Network code of the same name?

    What if you then assign a variable as the device ID in a command and the device specified by the variable does not have a command of the same name and same type, but DOES have one of that name, but different type?

    I.e. when swapping the device for the Panel, it CAN match e.g. HEX with Database, but can it match like that when the device ID is changed by variable?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Unless its changed I'm pretty sure you can not use a variable to change a database device code with a another devices pronto hex code.

    It was my understanding you could only swap like for like

    Database with database
    or
    pronto hex with pronto hex
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Yes, that was in my mind too, but then I noticed that if you swap devices for a Panel, it will certainly match HEX and Database codes. So I wondered if that would be the case when using a variable as the device ID. Surely they would use the same logic/code to do the swapping.

    Matching HEX to Network codes probably won't work (not tested that, even at the Panel level), but a definitive answer from iRule themselves would be good to have here.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Currently you can replace a device per panel swapping any code type within the builder, the same is not the case within the application.

    Within the application you can only swap controlled device of like code type. Network to Network, Database to Database ..
    • What about Database HEX?

      In many respects I think I'd prefer if the Builder worked the same way. I have found that swapping a device and then swapping back may not result in what you started with.

      As long as I know that the App only swaps to the SAME CODE TYPE, I can work with that. I just needed to be sure.

      Thanks.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned