Skip to content

Commit

Permalink
Use the absolute position to read the lock status (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipediel authored Apr 6, 2021
1 parent 5543f57 commit 195f23d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion broadlink/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 195f23d

Please # to comment.