mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.38k stars 478 forks source link

TypeError: unsupported operand type(s) for &: 'str' and 'int' #391

Closed salmorejos closed 4 years ago

salmorejos commented 4 years ago

I was using version 9 of broadlink and it worked fine for me. Due to some computer problems I had to reinstall broadlink and put version 14. Now, when I try to execute the code that previously worked, now these messages appear. Any easy tips for newbies? THANK YOU!

This is the messages that appear:

Call Stack information: File "C: \ Program Files (x86) \ National Instruments \ LabVIEW 2020 \ SOLAR REGULATOR PYTHON 2020 \ BROADLINK A1.py", line 7, in function devices.auth () File "C: \ Python27 \ broadlink \ init.py", line 224, in auth response = self.send_packet (0x65, payload) File "C: \ Python27 \ broadlink \ init.py", line 251, in send_packet packet [0x24] = self.devtype & 0xff

TypeError: unsupported operand type (s) for &: 'str' and 'int' broadlink a1

felipediel commented 4 years ago

Your are defining devtype as a string, but it should be a positive integer. Use 0x2714 for A1 devices.

salmorejos commented 4 years ago

Thanks, felipediel.