Skip to content

Commit

Permalink
Nitpicking
Browse files Browse the repository at this point in the history
  • Loading branch information
malmeloo committed Nov 20, 2024
1 parent 263cd5b commit 78d472b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions findmy/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,8 @@ def adv_key_b64(self) -> str:
@property
def mac_address(self) -> str:
"""Get the mac address from the public key."""
first_hex = self.adv_key_bytes[0] | 0b11000000
return (
parsers.format_hex_byte(first_hex)
+ ":"
+ ":".join([parsers.format_hex_byte(x) for x in self.adv_key_bytes[1:6]])
)
first_byte = (self.adv_key_bytes[0] | 0b11000000).to_bytes(1)
return ":".join([parsers.format_hex_byte(x) for x in first_byte + self.adv_key_bytes[1:6]])

@property
@override
Expand Down
4 changes: 2 additions & 2 deletions findmy/reports/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def confidence(self) -> int:
"""Confidence of the location of this report. Int between 1 and 3."""
# If the payload length is 88, the confidence is the 5th byte, otherwise it's the 6th byte
if len(self._payload) == 88:
return self.payload[4]
return self.payload[5]
return self._payload[4]
return self._payload[5]

@property
def latitude(self) -> float:
Expand Down

0 comments on commit 78d472b

Please sign in to comment.