supersaiyanmode / PyWebOSTV

Python API for controlling LG TVs (Web OS)
MIT License
261 stars 50 forks source link

Move mouse doesn't work #6

Closed Gustry closed 6 years ago

Gustry commented 6 years ago

Good evening, I got this issue while trying your readme. My InputControl is working well for all other commands listed. Thanks!

>>>inp.up()
>>>inp.move(10, 10)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/etienne/dev/python/PyWebOSTV/pywebostv/controls.py", line 221, in request_func
    params = process_payload(cmd_info["command"], *args, **kwargs)
  File "/Users/etienne/dev/python/PyWebOSTV/pywebostv/controls.py", line 33, in process_payload
    return [process_payload(item, *args, **kwargs) for item in obj]
  File "/Users/etienne/dev/python/PyWebOSTV/pywebostv/controls.py", line 33, in process_payload
    return [process_payload(item, *args, **kwargs) for item in obj]
  File "/Users/etienne/dev/python/PyWebOSTV/pywebostv/controls.py", line 37, in process_payload
    return obj(*args, **kwargs)
  File "/Users/etienne/dev/python/PyWebOSTV/pywebostv/controls.py", line 27, in func
    raise TypeError("Bad arguments.")
TypeError: Bad arguments.
supersaiyanmode commented 6 years ago

Hi @Gustry that sounds like a bug. I do not have an LG TV anymore, I wish there was some emulator that I could use.

Can you may be try one thing? On line 170 of pywebostv/controls.py, can you replace: ["down", arguments("drag", 0)]] with ["down", arguments("drag", default=0)]] and try again?

Gustry commented 6 years ago

Sad that you won't be able to develop this nice library anymore ;-)

It's working again. I included your patch in my PR #5

supersaiyanmode commented 6 years ago

Ohh, I still have a few more things to do in this project -- Apps. I have a Raspberry Pi (that I can access over internet) configured to interact with the TV back in my home country -- so getting access to an LG TV is not a problem. (And I get to cast random videos at random times from across the globe. :D )

Gustry commented 6 years ago

Ohhh, it would be very nice if we can play a movie using DLNA straight from a single python line (without having to emulate all buttons to get to the file browser in the UI), or to be able to cast a youtube link :D