From 73fc5fc4b97f3d62fee7b25a62622cd20bd586de Mon Sep 17 00:00:00 2001 From: Nick Dimov <3619341+dimovnike@users.noreply.github.com> Date: Sat, 27 Oct 2018 16:15:47 +0300 Subject: [PATCH] Support for a new SP2 device. It returns different codes for check and checknl. --- broadlink/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 9dccc8d..02a8e2a 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -399,12 +399,12 @@ class sp2(device): if err == 0: payload = self.decrypt(bytes(response[0x38:])) 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 else: state = False 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 else: state = False @@ -419,12 +419,12 @@ class sp2(device): if err == 0: payload = self.decrypt(bytes(response[0x38:])) 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 else: state = False 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 else: state = False