Skip to content

Instantly share code, notes, and snippets.

@jwoglom
Created February 12, 2023 03:13
Show Gist options
  • Save jwoglom/6830124953dc29530a49f3e0850c2e22 to your computer and use it in GitHub Desktop.
Save jwoglom/6830124953dc29530a49f3e0850c2e22 to your computer and use it in GitHub Desktop.
LG WebOS TV Web Browser Fullscreen
#!/usr/bin/env node
var lgtv = require("lgtv2")({
url: 'ws://livingroomtv:3000'
});
lgtv.on('connect', function () {
console.log('connected');
lgtv.getSocket('ssap://com.webos.service.networkinput/getPointerInputSocket',
function(err, sock) {
if (!err) {
const command = "move\n" + "dx:" + 11 + "\n" + "dy:-8\n" + "down:0\n" + "\n";
let times = 30;
for (let i=0; i < times; i++) {
setTimeout(()=>sock.send(command),i*25);
}
setTimeout(()=>sock.send('click'), times*25 + 200);
setTimeout(()=>process.exit(0), times*25 + 200 + 200);
}
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment