Skip to content

Commit

Permalink
feat(keypad-touch): use bitwise and for battery level
Browse files Browse the repository at this point in the history
  • Loading branch information
nickconway committed Oct 27, 2024
1 parent 2712a6b commit 5a61393
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion switchbot/adv_parsers/keypad.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def process_wokeypad(
if data:
_LOGGER.debug("data: %s", data.hex())

return {"battery": data[2], "attempt_state": mfr_data[6]}
return {"battery": data[2] & 0b01111111, "attempt_state": mfr_data[6]}

0 comments on commit 5a61393

Please sign in to comment.