mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-10 18:00:12 +01:00
Merge pull request #211 from dimovnike/master
Support for a new SP2 device.
This commit is contained in:
commit
5cfb92ee12
@ -399,12 +399,12 @@ class sp2(device):
|
|||||||
if err == 0:
|
if err == 0:
|
||||||
payload = self.decrypt(bytes(response[0x38:]))
|
payload = self.decrypt(bytes(response[0x38:]))
|
||||||
if type(payload[0x4]) == int:
|
if type(payload[0x4]) == int:
|
||||||
if payload[0x4] == 1 or payload[0x4] == 3:
|
if payload[0x4] == 1 or payload[0x4] == 3 or payload[0x4] == 0xFD:
|
||||||
state = True
|
state = True
|
||||||
else:
|
else:
|
||||||
state = False
|
state = False
|
||||||
else:
|
else:
|
||||||
if ord(payload[0x4]) == 1 or ord(payload[0x4]) == 3:
|
if ord(payload[0x4]) == 1 or ord(payload[0x4]) == 3 or ord(payload[0x4]) == 0xFD:
|
||||||
state = True
|
state = True
|
||||||
else:
|
else:
|
||||||
state = False
|
state = False
|
||||||
@ -419,12 +419,12 @@ class sp2(device):
|
|||||||
if err == 0:
|
if err == 0:
|
||||||
payload = self.decrypt(bytes(response[0x38:]))
|
payload = self.decrypt(bytes(response[0x38:]))
|
||||||
if type(payload[0x4]) == int:
|
if type(payload[0x4]) == int:
|
||||||
if payload[0x4] == 2 or payload[0x4] == 3:
|
if payload[0x4] == 2 or payload[0x4] == 3 or payload[0x4] == 0xFF:
|
||||||
state = True
|
state = True
|
||||||
else:
|
else:
|
||||||
state = False
|
state = False
|
||||||
else:
|
else:
|
||||||
if ord(payload[0x4]) == 2 or ord(payload[0x4]) == 3:
|
if ord(payload[0x4]) == 2 or ord(payload[0x4]) == 3 or ord(payload[0x4]) == 0xFF:
|
||||||
state = True
|
state = True
|
||||||
else:
|
else:
|
||||||
state = False
|
state = False
|
||||||
|
Loading…
Reference in New Issue
Block a user