Skip to content

Commit

Permalink
fix: add a guard to freshen_ble_device so it can be called on non-lin…
Browse files Browse the repository at this point in the history
…ux (#43)
  • Loading branch information
bdraco authored Sep 23, 2022
1 parent 99908a3 commit 4558a67
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bleak_retry_connector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ async def freshen_ble_device(device: BLEDevice) -> BLEDevice | None:
the RSSI changes so we may need to find the
path to the device ourselves.
"""
if not isinstance(device.details, dict) or "path" not in device.details:
if (
not IS_LINUX
or not isinstance(device.details, dict)
or "path" not in device.details
):
return None
return await get_bluez_device(device.name, device.details["path"], device.rssi)

Expand Down

0 comments on commit 4558a67

Please sign in to comment.