From 5dc01d792a72bc6e0fe0a2de941543eee1e7f04c Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Sat, 31 Jan 2026 10:55:58 -0800 Subject: [PATCH] address PR comments --- bumble/device.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bumble/device.py b/bumble/device.py index a244455b..46a5ffcc 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -3750,7 +3750,7 @@ async def connect_le( if self.is_le_connecting: raise InvalidStateError('connection already pending') - try_resolve = True + try_resolve = not self.address_resolution_offload if isinstance(peer_address, str): try: peer_address = hci.Address.from_string_for_transport( @@ -4073,10 +4073,6 @@ async def connect( [deprecated] (ignore) ''' - # Check parameters - if transport not in (PhysicalTransport.LE, PhysicalTransport.BR_EDR): - raise InvalidArgumentError('invalid transport') - # Connect using the appropriate transport # (auto-correct the transport based on declared capabilities) if transport == PhysicalTransport.LE or ( @@ -4088,14 +4084,15 @@ async def connect( own_address_type=own_address_type, timeout=timeout, ) - elif transport == PhysicalTransport.BR_EDR or ( + + if transport == PhysicalTransport.BR_EDR or ( self.classic_enabled and not self.le_enabled ): return await self.connect_classic( peer_address=peer_address, timeout=timeout ) - else: - raise InvalidArgumentError('no supported transport for request') + + raise ValueError('invalid transport') async def accept( self,