Ape / samsungctl

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

Python AtributeError #66

Closed TerrorSource closed 6 years ago

TerrorSource commented 6 years ago

Hi,

I've installed this on a RPi 3b with Jessie Lite and it gives me the following error. I'm trying this with a Samsung EU46ES6530.

pi@raspberrypi:~ $ samsungctl --host 192.168.192.25 --method legacy key key_poweroff Traceback (most recent call last): File "/usr/local/bin/samsungctl", line 9, in load_entry_point('samsungctl==0.7.0', 'console_scripts', 'samsungctl')() File "/usr/local/lib/python2.7/dist-packages/samsungctl/main.py", line 105, in main with Remote(config) as remote: File "/usr/local/lib/python2.7/dist-packages/samsungctl/remote.py", line 8, in init self.remote = RemoteLegacy(config) File "/usr/local/lib/python2.7/dist-packages/samsungctl/remote_legacy.py", line 31, in init self._read_response(True) File "/usr/local/lib/python2.7/dist-packages/samsungctl/remote_legacy.py", line 63, in _read_response tv_name_len = int.from_bytes(header[1:3], AttributeError: type object 'int' has no attribute 'from_bytes'

Python versions: pi@raspberrypi:~ $ python --version Python 2.7.9 pi@raspberrypi:~ $ python3 --version Python 3.4.2

Ape commented 6 years ago

Run samsungctl with Python 3. You might need to install it with pip3.

TerrorSource commented 6 years ago

used git clone and the following command. fixed the issue.

sudo python3 setup.py install