mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-27 12:55:32 +01:00
Try use bytes type
This commit is contained in:
parent
65f77279d5
commit
debc2f1e93
@ -1244,7 +1244,7 @@ message BluetoothGATTReadResponse {
|
||||
uint64 address = 1;
|
||||
uint32 handle = 2;
|
||||
|
||||
repeated uint32 data = 3 [packed=true];
|
||||
bytes data = 3;
|
||||
|
||||
}
|
||||
|
||||
@ -1257,7 +1257,7 @@ message BluetoothGATTWriteRequest {
|
||||
uint32 handle = 2;
|
||||
bool response = 3;
|
||||
|
||||
repeated uint32 data = 4 [packed=true];
|
||||
bytes data = 4;
|
||||
}
|
||||
|
||||
message BluetoothGATTReadDescriptorRequest {
|
||||
@ -1277,7 +1277,7 @@ message BluetoothGATTWriteDescriptorRequest {
|
||||
uint64 address = 1;
|
||||
uint32 handle = 2;
|
||||
|
||||
repeated uint32 data = 3 [packed=true];
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
message BluetoothGATTNotifyRequest {
|
||||
@ -1298,7 +1298,7 @@ message BluetoothGATTNotifyDataResponse {
|
||||
uint64 address = 1;
|
||||
uint32 handle = 2;
|
||||
|
||||
repeated uint32 data = 3 [packed=true];
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
message SubscribeBluetoothConnectionsFreeRequest {
|
||||
|
File diff suppressed because one or more lines are too long
@ -771,7 +771,7 @@ def _convert_bluetooth_le_service_data(
|
||||
) -> Dict[str, bytes]:
|
||||
if isinstance(value, dict):
|
||||
return value
|
||||
return {_long_uuid(v.uuid): bytes(v.data) for v in value} # type: ignore
|
||||
return {_long_uuid(v.uuid): v.data for v in value} # type: ignore
|
||||
|
||||
|
||||
def _convert_bluetooth_le_manufacturer_data(
|
||||
@ -779,7 +779,7 @@ def _convert_bluetooth_le_manufacturer_data(
|
||||
) -> Dict[int, bytes]:
|
||||
if isinstance(value, dict):
|
||||
return value
|
||||
return {int(v.uuid, 16): bytes(v.data) for v in value} # type: ignore
|
||||
return {int(v.uuid, 16): v.data for v in value} # type: ignore
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@ -812,7 +812,7 @@ class BluetoothGATTRead(APIModelBase):
|
||||
address: int = 0
|
||||
handle: int = 0
|
||||
|
||||
data: bytes = converter_field(default_factory=bytes, converter=bytes)
|
||||
data: bytes = b""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
Loading…
Reference in New Issue
Block a user