Created
February 12, 2023 03:13
-
-
Save jwoglom/6830124953dc29530a49f3e0850c2e22 to your computer and use it in GitHub Desktop.
LG WebOS TV Web Browser Fullscreen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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