mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-12-22 16:48:04 +01:00
Add address_type to BluetoothLEAdvertisementResponse and BluetoothDeviceRequest (#320)
This commit is contained in:
parent
073b564bb0
commit
a937d9d85a
@ -1167,6 +1167,7 @@ message BluetoothLEAdvertisementResponse {
|
|||||||
repeated string service_uuids = 4;
|
repeated string service_uuids = 4;
|
||||||
repeated BluetoothServiceData service_data = 5;
|
repeated BluetoothServiceData service_data = 5;
|
||||||
repeated BluetoothServiceData manufacturer_data = 6;
|
repeated BluetoothServiceData manufacturer_data = 6;
|
||||||
|
uint32 address_type = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BluetoothDeviceRequestType {
|
enum BluetoothDeviceRequestType {
|
||||||
@ -1185,6 +1186,8 @@ message BluetoothDeviceRequest {
|
|||||||
|
|
||||||
uint64 address = 1;
|
uint64 address = 1;
|
||||||
BluetoothDeviceRequestType request_type = 2;
|
BluetoothDeviceRequestType request_type = 2;
|
||||||
|
bool has_address_type = 3;
|
||||||
|
uint32 address_type = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BluetoothDeviceConnectionResponse {
|
message BluetoothDeviceConnectionResponse {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -494,6 +494,7 @@ class APIClient:
|
|||||||
disconnect_timeout: float = DEFAULT_BLE_DISCONNECT_TIMEOUT,
|
disconnect_timeout: float = DEFAULT_BLE_DISCONNECT_TIMEOUT,
|
||||||
version: int = 1,
|
version: int = 1,
|
||||||
has_cache: bool = False,
|
has_cache: bool = False,
|
||||||
|
address_type: Optional[int] = None,
|
||||||
) -> Callable[[], None]:
|
) -> Callable[[], None]:
|
||||||
self._check_authenticated()
|
self._check_authenticated()
|
||||||
|
|
||||||
@ -522,7 +523,12 @@ class APIClient:
|
|||||||
request_type = BluetoothDeviceRequestType.CONNECT
|
request_type = BluetoothDeviceRequestType.CONNECT
|
||||||
|
|
||||||
await self._connection.send_message_callback_response(
|
await self._connection.send_message_callback_response(
|
||||||
BluetoothDeviceRequest(address=address, request_type=request_type),
|
BluetoothDeviceRequest(
|
||||||
|
address=address,
|
||||||
|
request_type=request_type,
|
||||||
|
has_address_type=address_type is not None,
|
||||||
|
address_type=address_type or 0,
|
||||||
|
),
|
||||||
on_msg,
|
on_msg,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -797,6 +797,7 @@ class BluetoothLEAdvertisement(APIModelBase):
|
|||||||
address: int = 0
|
address: int = 0
|
||||||
name: str = ""
|
name: str = ""
|
||||||
rssi: int = 0
|
rssi: int = 0
|
||||||
|
address_type: int = 0
|
||||||
|
|
||||||
service_uuids: List[str] = converter_field(
|
service_uuids: List[str] = converter_field(
|
||||||
default_factory=list, converter=_convert_bluetooth_le_service_uuids
|
default_factory=list, converter=_convert_bluetooth_le_service_uuids
|
||||||
|
Loading…
Reference in New Issue
Block a user