supersaiyanmode/PyWebOSTV

How do I avoid registering with the API?

Juanipis opened this issue · 6 comments

I'm trying to put data into the "store" dictionary but it doesn't work. Any guide or example to do it?

Please explain "it doesn't work"? What happens exactly? Can you please attach your full source code? At the moment, implementation of a "store" object is outside the scope of this library.

It is really up to do, all the object needs to do is behave like a dictionary. I might have an example, I'll attach it soon.

I write
`
store = {'key' : '12345678'}

client = WebOSClient.discover()[0]
client.connect()
for status in client.register(store):
if status == WebOSClient.PROMPTED:
print("Please accept the connect on the TV!")
elif status == WebOSClient.REGISTERED:
print("Registration successful!")
`
But always the tv ask me if i want acces

  1. Use an empty store dictionary in the first line
  2. Go through the rest of the code
  3. The library will populate the store dictionary for you, when you reach "Registration successful" stage.
  4. Once the registration is complete, save the dictionary to the file/DB/etc. Next time your app opens, read this DB and populate the store with the value you previously stored. If you do it correctly, you won't have to go through authorization process on the TV the second time.

Also, I think this is broadly explained in the README. Feel free to send me a PR to update the README if you feel the instructions aren't super clear.

I just updated the a little bit the example, please have a look again https://github.com/supersaiyanmode/PyWebOSTV/blob/master/README.md#establishing-the-connection

Ah ok, now is super clear, thanks

Let's close this ticket