This commit is contained in:
J. Nick Koston 2023-11-28 07:58:10 -06:00
parent 05f6b291df
commit 88527aee0f
No known key found for this signature in database
1 changed files with 3 additions and 12 deletions

View File

@ -460,10 +460,7 @@ class APIClient:
BluetoothDeviceConnectionResponse,
),
)
if (
type(msg) # pylint: disable=unidiomatic-typecheck
is BluetoothDeviceConnectionResponse
):
if type(msg) is BluetoothDeviceConnectionResponse:
return bool(msg.address == address)
return bool(msg.address == address and msg.handle == handle)
@ -489,10 +486,7 @@ class APIClient:
timeout,
)
if (
type(resp) # pylint: disable=unidiomatic-typecheck
is BluetoothGATTErrorResponse
):
if type(resp) is BluetoothGATTErrorResponse:
raise BluetoothGATTAPIError(BluetoothGATTError.from_pb(resp))
self._raise_for_ble_connection_change(address, resp, msg_types)
@ -718,10 +712,7 @@ class APIClient:
msg_types: tuple[type[message.Message], ...],
) -> None:
"""Raise an exception if the connection status changed."""
if (
type(response) # pylint: disable=unidiomatic-typecheck
is not BluetoothDeviceConnectionResponse
):
if type(response) is not BluetoothDeviceConnectionResponse:
return
response_names = message_types_to_names(msg_types)
human_readable_address = to_human_readable_address(address)