seydx / homebridge-bravia-tvos

Homebridge plugin for Sony Bravia Android TVs
MIT License
347 stars 32 forks source link

Feature Request: Rebind Remote Buttons to Open App #134

Open SupImDos opened 3 years ago

SupImDos commented 3 years ago

Hi,

Would it be possible to add a feature where we can rebind any action to the remote keys (e.g. App, Channel or Input), not just the ircc commands? This would be useful for users such as myself that use a different launcher on their Bravia TV.

Something like this:

"remote": [
  {
    "app": "URI_FOR_MY_APP",
    "target": "INFORMATION"
  }
]

I want to rebind the INFORMATION key on the remote to launch an app instead of send an ircc command.

Currently, I modify the source code to replace the following lines in tv.js:

https://github.com/SeydX/homebridge-bravia-tvos/blob/258fae2e4797ee09a994f5d82b2031dfa24b6dc8/src/accessories/tv.js#L408-L411

with this:

case this.api.hap.Characteristic.RemoteKey.INFORMATION:
  Logger.info('Changing application to MY_APP_NAME');  
  await this.bravia.appControl.invoke('setActiveApp', '1.0', { uri: 'URI_FOR_MY_APP' });
  break;

Clearly, modifying the source code after each update is not the best solution, so I am wondering if a feature like this would ever be in the scope of this plugin?

Thanks, SupImDos

SupImDos commented 3 years ago

Bump on this. Is this possible in v.5.x.x?