i0null / homebridge-lgtv-2012

LG TV 2012 plugin for Homebridge
MIT License
6 stars 2 forks source link

Pairing key #1

Closed kirtilli closed 7 years ago

kirtilli commented 7 years ago

How can i get a pairing key for the TV? Best

i0null commented 7 years ago

Hi it should be automatic during the identify phase of setup, if its not provided.

But a nicer way of getting it ( instead to having to reset the config ) is to run the following command (replacing 172.16.0.10 with your tv's ip):

node -e "lg = require('lgtv-2012').lgtv; tv = new lg({host: '172.16.0.10'}); tv.pair_request(()=>{})"

So thanks for letting me know as i've updated the docs.

If you get an error try npm updatefirst.

kirtilli commented 7 years ago

Thanks for the quick replay but when i run your code snippet, ı got following error. (İ did npm update first)

throw err; ^

Error: Cannot find module 'lgtv-2012' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at [eval]:1:6 at ContextifyScript.Script.runInThisContext (vm.js:23:33) at Object.exports.runInThisContext (vm.js:74:17) at Object. ([eval]-wrapper:6:22) at Module._compile (module.js:571:32) at Immediate. (bootstrap_node.js:387:29)

i0null commented 7 years ago

Ahh, its because lgtv-2012 is a dependency that's not installed of globaly. try running the command inside the homebridge-lgtv-2012 folder.