- Posted on
Mon Oct 30, 2017 10:53 am
-
kennybroh
offline
-
- Posts: 531
- Joined: Dec 13, 2009
- Location: Baltimore
Yes, that's the idea. For instance, I have 6 or 7 DirecTV boxes, most of which are connected to Onkyo receivers. I also have Sonos and AppleTVs in those rooms, hooked up to the Onkyos. I have control pages for each room, because the lighting, hvac and relevant action groups differ dependnig on where you are.
So, for example, when I press Guide, I call a python script that checks the variable for the room you are in--which is presently set only by the button that selects the page--and on that basis knows which DirecTV box to pass the command to. I don't want to have hard coded actions on each page because, for instance, even though I use static IPs when I can, sometimes the addresses of the devices change and it is a nightmare to update the pages when something like that happens. This way the scripts look at variables which hold the IP address for each box.
But as you correctly point out, where multiple devices are used--whether by multiple people one--the variable for the room can get out of synch. Hence the desire to be able to have an internal variable pass the control page, or even control, ID. As you also observed, that could be extremely useful for many purposes.
In other high level languages I've used, the GUI has "embed points", which I badly miss in Indigo, where you can insert scripts to be processed before and /or after the control event itself. For example, in additon to what Indigo now does--having a control call a client and/or server event of some sort,--you could also add events before or after what the control itself calls. So in this context, my "Guide" control could set the page name, and then call the action group. The same concept would apply to the page itself--you could have an event process before the page opens, and on exit from the page.
Which brings something to mind I just thought of . If a control calls both client-side and server-side event, does the client-side execute first? If so, I could accomplish some of what I'd like to do that way.