- Posted on
Tue Aug 09, 2011 8:23 pm
-
matt (support)
offline
- Site Admin
-
- Posts: 21429
- Joined: Jan 27, 2003
- Location: Texas
-
Good questions, and I'm not sure of the right answers. Creating an IR plugin, regardless of hardware, is pretty complex especially if the hardware doesn't have an IR database and requires IR learning.
I'm not sure if I would try to create a mapping of IR receiving device (TV, amp, DVD, etc.) to Device instances. Instead, I would probably have the device be the USB-UIRT itself, then provide a mechanism for learning and storing the sets of all IR codes needed for all devices. I'm then not sure at what level I would store the IR data (device or global plugin). Either way, the plugin API provides an easy way to store indigo.Dict() and indigo.List() objects, where the values can be arbitrary strings (or bools, ints, etc.). So you can encode the learned IR code into a string, then just store it in the plugin (or device if you decide to make it device level) dict and the Indigo Server will take care of storing the values for you.
And if it is only possible (or useful) for a single USB-UIRT to be connected to the Indigo Mac, then you could just skip devices altogether -- just have everything being global at the plugin level. In that case, the user wouldn't create any Devices in Indigo, they would just turn on the plugin and configure it (including teaching it IR codes and assigning those names). Likewise the actions to send IR codes wouldn't be device specific, they would just be plugin actions.