1
0
mirror of https://github.com/mjg59/python-broadlink.git synced 2024-11-10 18:00:12 +01:00

fix check_power for SP2/SP3 (#72)

Fixed up to avoid merge conflict with #78
This commit is contained in:
Dimitrij 2017-04-22 22:36:50 +03:00 committed by Matthew Garrett
parent 4f03ffb963
commit d346476e63

View File

@ -374,7 +374,11 @@ class sp2(device):
err = response[0x22] | (response[0x23] << 8)
if err == 0:
payload = self.decrypt(bytes(response[0x38:]))
return bool(payload[0x4])
if type(payload[0x4]) == int:
state = bool(payload[0x4])
else:
state = bool(ord(payload[0x4]))
return state
class a1(device):
def __init__ (self, host, mac):