jcarbaugh / python-roku

Screw remotes. Control your Roku with Python.
https://pypi.python.org/pypi/roku
BSD 3-Clause "New" or "Revised" License
288 stars 94 forks source link

r.apps is not a valid method #8

Closed controversial closed 5 years ago

controversial commented 8 years ago

The examples mention a r.apps method, which doesn't seem to work.

jcarbaugh commented 8 years ago

apps is actually a property, so it should be invoked as r.apps instead of r.apps(). Do you have some example code that would show the issue you've come across?

controversial commented 8 years ago

I can't even make

import roku

r = roku.Roku('192.168.1.110')
apps = r.apps

work. Is it an incompatibility with certain roku boxes?

jcarbaugh commented 8 years ago

Huh. Maybe. Does it throw an error or does apps just return an empty list?

controversial commented 8 years ago

Throws an error from line 84 in

def __getattr__(self, name):

    if name not in COMMANDS and name not in SENSORS:
        raise AttributeError('%s is not a valid method' % name)
jcarbaugh commented 8 years ago

And just for reference, are you using Python 2 or 3?

controversial commented 8 years ago

Python 2. Other things that might matter but don't think so- running through pythonista on iOS. I replaced the import of lxml with xml, because I read the etree functions are basically the same. If this is the issue, I'll feel pretty stupid.

controversial commented 8 years ago

I did get this to work on the same device with someone else's roku, still replacing lxml with xml. I assume it's an incompatibility with my Roku.

adamsong commented 7 years ago

Is the code not supposed to be

from roku import Roku
r = Roku(ip)
r.apps
iantrich commented 5 years ago

Fixed in https://github.com/jcarbaugh/python-roku/pull/36