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