tweak tests
This commit is contained in:
parent
6b01938df6
commit
36510f4f58
|
@ -83,6 +83,7 @@ from .client_callbacks import (
|
|||
from .connection import APIConnection, ConnectionParams, handle_timeout
|
||||
from .core import (
|
||||
APIConnectionError,
|
||||
BluetoothConnectionDroppedError,
|
||||
BluetoothGATTAPIError,
|
||||
TimeoutAPIError,
|
||||
to_human_readable_address,
|
||||
|
@ -160,10 +161,6 @@ ExecuteServiceDataType = dict[
|
|||
]
|
||||
|
||||
|
||||
class BluetoothConnectionDroppedError(APIConnectionError):
|
||||
"""Raised when a Bluetooth connection is dropped."""
|
||||
|
||||
|
||||
def _stringify_or_none(value: str | None) -> str | None:
|
||||
"""Convert a string like object to a str or None.
|
||||
|
||||
|
|
|
@ -228,6 +228,10 @@ class UnhandledAPIConnectionError(APIConnectionError):
|
|||
pass
|
||||
|
||||
|
||||
class BluetoothConnectionDroppedError(APIConnectionError):
|
||||
"""Raised when a Bluetooth connection is dropped."""
|
||||
|
||||
|
||||
def to_human_readable_address(address: int) -> str:
|
||||
"""Convert a MAC address to a human readable format."""
|
||||
return ":".join(TWO_CHAR.findall(f"{address:012X}"))
|
||||
|
|
Loading…
Reference in New Issue