Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion smpclient/transport/ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def connect(self, address: str, timeout_s: float) -> None:
device: BLEDevice | None = (
await BleakScanner.find_device_by_address(address, timeout=timeout_s)
if MAC_ADDRESS_PATTERN.match(address) or UUID_PATTERN.match(address)
else await BleakScanner.find_device_by_name(address)
else await BleakScanner.find_device_by_name(address, timeout=timeout_s)
)

if type(device) is BLEDevice:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_smp_ble_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def test_connect(
) -> None:
# assert that it searches by name if MAC or UUID is not provided
await SMPBLETransport().connect("device name", 1.0)
mock_find_device_by_name.assert_called_once_with("device name")
mock_find_device_by_name.assert_called_once_with("device name", timeout=1.0)
mock_find_device_by_name.reset_mock()

# assert that it searches by MAC if MAC is provided
Expand Down
Loading