mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-12-27 17:37:39 +01:00
Remove _convert_bluetooth_le_name as it did not need to be its own function (#423)
This commit is contained in:
parent
4abe5fd959
commit
d1951ebd90
@ -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
|
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)
|
@dataclass(frozen=True)
|
||||||
class BluetoothLEAdvertisement(APIModelBase):
|
class BluetoothLEAdvertisement(APIModelBase):
|
||||||
def __post_init__(self) -> None:
|
def __post_init__(self) -> None:
|
||||||
@ -867,7 +863,7 @@ class BluetoothLEAdvertisement(APIModelBase):
|
|||||||
address=data.address,
|
address=data.address,
|
||||||
rssi=data.rssi,
|
rssi=data.rssi,
|
||||||
address_type=data.address_type,
|
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_uuids=_convert_bluetooth_le_service_uuids(data.service_uuids),
|
||||||
service_data=_convert_bluetooth_le_service_data(data.service_data),
|
service_data=_convert_bluetooth_le_service_data(data.service_data),
|
||||||
manufacturer_data=_convert_bluetooth_le_manufacturer_data(
|
manufacturer_data=_convert_bluetooth_le_manufacturer_data(
|
||||||
|
Loading…
Reference in New Issue
Block a user