hi zak45, i found something strange in your code
-------------device-------------------
CentOS 7 x64
RM Pro Plus
Python 3.6
Domoticz V4.9732
-------------environment--------------
broadlink 0.9
pip 10.0.1
pyaes 1.6.0
PyCRC 1.21
pycrypto 2.6.1
setuptools 28.8.0
------------------------------------------
notice:if i remove pycrypto, the method broadlink.auth() will throw Error like:
Code: Select all
Traceback (most recent call last):
File "test.py", line 22, in <module>
Discover()
File "test.py", line 17, in Discover
brodevices[index].auth()
File "/usr/local/python3.6.1/lib/python3.6/broadlink/__init__.py", line 203, in auth
response = self.send_packet(0x65, payload)
File "/usr/local/python3.6.1/lib/python3.6/broadlink/__init__.py", line 258, in send_packet
payload = self.encrypt(payload)
File "/usr/local/python3.6.1/lib/python3.6/broadlink/__init__.py", line 162, in encrypt_pyaes
return "".join([aes.encrypt(bytes(payload[i:i+16])) for i in range(0, len(payload), 16)])
TypeError: sequence item 0: expected str instance, bytes found
so i reinstall it and works...
than i locate the error in the plugin.py:752
Code: Select all
device = broadlink.rm(host=(Parameters["Address"],80), mac=bytearray.fromhex(Parameters["Mode1"]), devtype = Parameters["Mode3"])
it throw Error like:
Code: Select all
TypeError: __init__() got an unexpected keyword argument 'devtype'
maybe 'devtype' is wrong argument?
And i remove it
Code: Select all
device = broadlink.rm(host=(Parameters["Address"],80), mac=bytearray.fromhex(Parameters["Mode1"]))
after restart, it can run...
I'm confused...again...