From fc5c33ee97113af2fbb64b5f6a498813d07ba13e Mon Sep 17 00:00:00 2001 From: Felipe Martins Diel <41558831+felipediel@users.noreply.github.com> Date: Tue, 6 Apr 2021 15:28:12 -0300 Subject: [PATCH] Use the absolute position to read the lock status (#575) --- broadlink/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broadlink/device.py b/broadlink/device.py index f65f54b..1399628 100644 --- a/broadlink/device.py +++ b/broadlink/device.py @@ -64,7 +64,7 @@ def scan( discovered.append((host, mac, devtype)) name = resp[0x40:].split(b"\x00")[0].decode() - is_locked = bool(resp[-1]) + is_locked = bool(resp[0x7F]) yield devtype, host, mac, name, is_locked finally: conn.close()