Closed Paxy closed 3 years ago
@Paxy I just tested my SP2 plug and I got the same issue as yours. I noticed that the return statement is missing something. Simply replace the return statement on broadlink/init.py line 355 and it should work:
from
return bool(payload[0x4])
to
return bool(ord(payload[0x4]))
I have submitted a PR #52
@eddyyanto this change will break Python 3 compatibility. You should check the type of payload[0x4] before doing the casting to ord as is done in other devices (A1 or MP1).
Hi, I recently bought 3 EU style SP2 for $10 each from aliexpress, and had the same issue. Aa @vicfergar pointed out it should probably be something like: payload = aes.decrypt(bytes(response[0x38:]))
When looking at the mp1 check_power_raw() code I noticed that type check is for offset 0x04 but it actually uses payload[0x0e] - is that intentional?
I have a patch lying around to read out the name of the device as well - not sure if that is valid for anything else than SP2 devices though.
@vicfergar Ah, ok. Thanks for the info!
when testing the actual master branch, It seems this issue is still open.
Same issue here.
Fixed with https://github.com/mjg59/python-broadlink/pull/72. Thank you!
Example code:
Always returns True desn't matter what is actual state. set_power(*) is working correctly.