Ape / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
713 stars 191 forks source link

TypeError: __init__() takes exactly 4 arguments (1 given) #26

Closed fergalom closed 7 years ago

fergalom commented 7 years ago

Have python3 and websocket installed. Below is my conf and the error from samsungctl - any advice how to solve?

pi@raspberrypi ~ $ samsungctl --host 192.168.1.24 KEY_VOLUP

Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 9, in <module>
    load_entry_point('samsungctl==0.6.0', 'console_scripts', 'samsungctl')()
  File "/usr/local/lib/python3.2/dist-packages/samsungctl/__main__.py", line 101, in main
    with Remote(config) as remote:
  File "/usr/local/lib/python3.2/dist-packages/samsungctl/remote.py", line 10, in __init__
    self.remote = RemoteWebsocket(config)
  File "/usr/local/lib/python3.2/dist-packages/samsungctl/remote_websocket.py", line 21, in __init__
    self.connection = websocket.WebSocket()
TypeError: __init__() takes exactly 4 arguments (1 given)

My conf:

pi@raspberrypi ~ $ cat .config/samsungctl.conf
{
        "name": "samsungctl",
        "description": "PC",
        "id": "",
        "method": "websocket",
        "port": 7676,
        "timeout": 0
}
thaihenry commented 7 years ago

Same problem on newer TV except I am using the default port 8001:

Traceback (most recent call last): File "/usr/local/bin/samsungctl", line 11, in sys.exit(main()) File "/usr/local/lib/python3.4/dist-packages/samsungctl/main.py", line 101, in main with Remote(config) as remote: File "/usr/local/lib/python3.4/dist-packages/samsungctl/remote.py", line 10, in init self.remote = RemoteWebsocket(config) File "/usr/local/lib/python3.4/dist-packages/samsungctl/remote_websocket.py", line 21, in init self.connection = websocket.WebSocket() TypeError: init() missing 3 required positional arguments: 'environ', 'socket', and 'rfile'

thaihenry commented 7 years ago

This is working for me: https://github.com/krzynio/python-samsung-smarttv-2016

fergalom commented 7 years ago

got this working. Key was python3.5 on a Rasppi and websocket-client Working a Samsung K6400