address PR comments

This commit is contained in:
Gilles Boccon-Gibod
2022-11-09 13:18:30 -08:00
parent 4a1345cf95
commit 0f219eff12
2 changed files with 9 additions and 3 deletions

View File

@@ -1211,9 +1211,7 @@ class Device(CompositeEventEmitter):
if type(peer_address) is str:
try:
peer_address = Address(peer_address)
if transport == BT_BR_EDR_TRANSPORT:
peer_address.address_type = Address.PUBLIC_DEVICE_ADDRESS
peer_address = Address.from_string_for_transport(peer_address, transport)
except ValueError:
# If the address is not parsable, assume it is a name instead
logger.debug('looking for peer by name')