mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-27 12:55:32 +01:00
Fix bytes
This commit is contained in:
parent
debc2f1e93
commit
a3904aabfd
@ -545,7 +545,7 @@ class APIClient:
|
||||
req.address = address
|
||||
req.handle = characteristic_handle
|
||||
req.response = response
|
||||
req.data.extend(list(data))
|
||||
req.data = data
|
||||
|
||||
assert self._connection is not None
|
||||
await self._connection.send_message(req)
|
||||
@ -593,7 +593,7 @@ class APIClient:
|
||||
req = BluetoothGATTWriteDescriptorRequest()
|
||||
req.address = address
|
||||
req.handle = handle
|
||||
req.data.extend(list(data))
|
||||
req.data = data
|
||||
|
||||
assert self._connection is not None
|
||||
await self._connection.send_message(req)
|
||||
|
@ -771,7 +771,8 @@ def _convert_bluetooth_le_service_data(
|
||||
) -> Dict[str, bytes]:
|
||||
if isinstance(value, dict):
|
||||
return value
|
||||
return {_long_uuid(v.uuid): v.data for v in value} # type: ignore
|
||||
|
||||
return {_long_uuid(v.uuid): bytes(v.data) for v in value} # type: ignore
|
||||
|
||||
|
||||
def _convert_bluetooth_le_manufacturer_data(
|
||||
@ -779,7 +780,7 @@ def _convert_bluetooth_le_manufacturer_data(
|
||||
) -> Dict[int, bytes]:
|
||||
if isinstance(value, dict):
|
||||
return value
|
||||
return {int(v.uuid, 16): v.data for v in value} # type: ignore
|
||||
return {int(v.uuid, 16): bytes(v.data) for v in value} # type: ignore
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
Loading…
Reference in New Issue
Block a user