Skip to content

Commit

Permalink
fix: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernst79 committed May 3, 2023
1 parent d61e63e commit 26bc5d2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/bthome_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,7 @@ def _parse_bthome_v2(
payload = data[1:]

# If True, the device is not updating regularly
sleepy_device = adv_info & (1 << 2) # bit 2
if sleepy_device:
self.sleepy_device = True
else:
self.sleepy_device = False
self.sleepy_device = bool(adv_info & (1 << 2)) # bit 2

# Check BTHome version
sw_version = (adv_info >> 5) & 7 # 3 bits (5-7)
Expand Down

0 comments on commit 26bc5d2

Please sign in to comment.