hobbyquaker / lgtv2

Control LG WebOS TV using node.js :tv:
MIT License
334 stars 44 forks source link

switchInput example #6

Closed rooi closed 7 years ago

rooi commented 7 years ago

Hi,

Create project! I would like to use switchInput to change the hdmi, but can't seem to find the right command. Could you please give an example on how to use this command? I've found some other sources that use the same api, but no official documentation. Do you have a link for that as well?

Thanks!

Roy

chrpeters commented 7 years ago

I was able to get all main menu launch points using

lgtv.request('ssap://com.webos.applicationManager/listLaunchPoints', function (err, res) {
   var launchPoints = res.launchPoints;
});

The object also contains all of the ids. To switch to hdmi2, I use: lgtv.request('ssap://system.launcher/launch', {id: 'com.webos.app.hdmi2'});

rooi commented 7 years ago

Nice! That was exactly what I needed. Works on my 55e6

rooi commented 7 years ago

One more question... is there a command to request the current active hdmi source (or app)?

Thanks!