From d1951ebd9065a38dfbd61e19d6923c35ff3d2436 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 19 Apr 2023 20:47:26 -1000 Subject: [PATCH] Remove _convert_bluetooth_le_name as it did not need to be its own function (#423) --- aioesphomeapi/model.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/aioesphomeapi/model.py b/aioesphomeapi/model.py index 612104b..362e4ec 100644 --- a/aioesphomeapi/model.py +++ b/aioesphomeapi/model.py @@ -842,10 +842,6 @@ def _convert_bluetooth_le_manufacturer_data( return {int(v.uuid, 16): bytes(v.legacy_data) for v in value} # type: ignore -def _convert_bluetooth_le_name(value: bytes) -> str: - return value.decode("utf-8", errors="replace") - - @dataclass(frozen=True) class BluetoothLEAdvertisement(APIModelBase): def __post_init__(self) -> None: @@ -867,7 +863,7 @@ class BluetoothLEAdvertisement(APIModelBase): address=data.address, rssi=data.rssi, address_type=data.address_type, - name=_convert_bluetooth_le_name(data.name), + name=data.name.decode("utf-8", errors="replace"), service_uuids=_convert_bluetooth_le_service_uuids(data.service_uuids), service_data=_convert_bluetooth_le_service_data(data.service_data), manufacturer_data=_convert_bluetooth_le_manufacturer_data(