Page 1 of 4

Universal Controls Option

PostPosted: Sat Dec 10, 2016 4:52 pm
by durosity
Hey,

a while ago i floated the idea of a universal control option that'd select the relevant command based on the activity (in much the same way as the harmony remotes/app works). I'm curious as to if you think that'll be something implemented in the short, medium or never term.. i don't wanna go to the effort of creating action groups and scripts for each individual command that i want only to find out you're already working on an internal way of doing it. :)

(viewtopic.php?f=212&t=16166&start=150#p124067)

Re: Universal Controls Option

PostPosted: Sat Dec 10, 2016 4:57 pm
by FlyingDiver
I'll have to look at that again. I'm assuming you mean the same way the volume controls work now?

Re: Universal Controls Option

PostPosted: Sat Dec 10, 2016 5:05 pm
by durosity
Yeah, so essentially a way of mapping different device commands to one control page button and would envolk the right command for the current activity. EG Pressing a NAV UP button on a control page would look to see if i'm currently using the Watch TV activity or Play Xbox then send the relevant command for that device.

Re: Universal Controls Option

PostPosted: Sat Dec 10, 2016 5:50 pm
by FlyingDiver
I took a look (again) at the config data I get back from the hub, and I have a glimmer of an idea of how to do this. I'm not going to create all the command groups and commands in advance, and then try to map them to devices at run time. That would be a maintenance nightmare. So I need to see if I can create it all on the fly when you attempt to assign an action to a control page button (or whatever). The tricky part is going to be run-time validation for cases where a certain mapping was valid when you created the control page, but no longer is.

If I can do it at all, it'll be within a few weeks. End of them month, anyway.

Re: Universal Controls Option

PostPosted: Sun Dec 11, 2016 7:29 pm
by FlyingDiver
Well, this seems to work for me. It needs a lot of testing.

https://github.com/FlyingDiver/Indigo-H ... .1.0-beta1

Re: Universal Controls Option

PostPosted: Mon Dec 12, 2016 2:04 am
by durosity
Very cool, i'll try it out this evening! Thanks!

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:16 pm
by durosity
Sorry i wasn't able to test sooner, got roped into doing overtime at work!

This is looking awesome. I've had a bit of a play this evening and it looks good. Couple of minor things i may need to make scripts for like the difference between Xbox buttons and PS buttons.. but in general it seems to be doing what i want!

One minor issue is though that if a particular device doesn't support an intended action i get an error like this:

Code: Select all
   Action Group                    zz harmony 668
   Harmony Hub Error               Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 269, in sendCurrentActivityCommand
TypeError: coercing to Unicode: need string or buffer, NoneType found

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:28 pm
by FlyingDiver
Yeah, I forgot to account for that in beta1. This one should fix it:

https://github.com/FlyingDiver/Indigo-H ... .1.0-beta2

What's going on with Xbox vs PS? Is it something that the Harmony knows to do differently?

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:35 pm
by durosity
Yeah they have different "Command Groups" of "GameType1" for xbox commands (A, B, X, Y) and "GameType2" (Circle, Cross, Triangle, Square) for ps4 and i'm gonna guess others will appear as i add them to the system (not sure how it'll handle also having a PS3 as that's yet to be configured.)

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:39 pm
by durosity
Oops installing that plugin states that it's already installed... same version number as before? (I've replaced it manually and seems to work)

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:51 pm
by FlyingDiver
durosity wrote:
Oops installing that plugin states that it's already installed... same version number as before? (I've replaced it manually and seems to work)


Yeah, the betas are all the same version number.

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:56 pm
by FlyingDiver
durosity wrote:
Yeah they have different "Command Groups" of "GameType1" for xbox commands (A, B, X, Y) and "GameType2" (Circle, Cross, Triangle, Square) for ps4 and i'm gonna guess others will appear as i add them to the system (not sure how it'll handle also having a PS3 as that's yet to be configured.)


I see. My Fire TV is GameType3, with just one Action in the group. What a waste. ;)

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 4:58 pm
by durosity
Hehe yeah I've got a couple that just have one in them!

Hmm.. that's a thought actually, could the sub folders be stripped just to leave the actual commands? As best I can tell there's no overlap and I don't think it'd cause any confusion as to what they do?

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 5:03 pm
by FlyingDiver
durosity wrote:
Hehe yeah I've got a couple that just have one in them!

Hmm.. that's a thought actually, could the sub folders be stripped just to leave the actual commands? As best I can tell there's no overlap and I don't think it'd cause any confusion as to what they do?


You mean merge the Command Group and Command popups? Yeah, I could, but I won't. I HATE long lists in popups. Programmer's prerogative.

Re: Universal Controls Option

PostPosted: Sat Dec 17, 2016 5:03 pm
by durosity
Fair nuf, thought it might just simply things! No biggie!