Skip to content

Commit

Permalink
fix: fix test regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Jc2k committed Jul 22, 2022
1 parent 55d67d7 commit 1f80374
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/xiaomi_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,10 @@ def _start_update(self, service_info: BluetoothServiceInfo) -> None:
self.set_device_manufacturer("Xiaomi")
self.set_device_name(service_info.name)

mac_readable = "00:00:00:00:00:00"
if sys.platform != "darwin":
mac_readable = service_info.address
mac_readable = service_info.address
if len(mac_readable) != 17 and mac_readable[2] != ":":
# On macOS we get a UUID, which is useless for MiBeacons
mac_readable = "00:00:00:00:00:00"

mac = bytes.fromhex(mac_readable.replace(":", ""))

Expand Down

0 comments on commit 1f80374

Please sign in to comment.