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

launch() returning exception - Roku returning 204 response #15

Closed shenning00 closed 7 years ago

shenning00 commented 7 years ago

Roku will respond with a 204 if launch() is called to launch an app that is already running.

        if resp.status_code != 200:
            raise RokuException(resp.content)

The status 200 and 204 need to be checked before an exception is thrown.

The code should read:


        if resp.status_code not in [200, 204]:
            raise RokuException(resp.content)