tweak tests

This commit is contained in:
J. Nick Koston 2023-11-28 07:14:47 -06:00
parent 6b01938df6
commit 36510f4f58
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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}"))