mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2025-02-26 03:21:46 +01:00
Change to error int
This commit is contained in:
parent
0c5d109951
commit
869ba8c977
@ -1187,7 +1187,7 @@ message BluetoothDeviceConnectionResponse {
|
|||||||
uint64 address = 1;
|
uint64 address = 1;
|
||||||
bool connected = 2;
|
bool connected = 2;
|
||||||
uint32 mtu = 3;
|
uint32 mtu = 3;
|
||||||
bool failed = 4;
|
int error = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BluetoothGATTGetServicesRequest {
|
message BluetoothGATTGetServicesRequest {
|
||||||
|
@ -446,8 +446,7 @@ class APIClient:
|
|||||||
async def bluetooth_device_connect(
|
async def bluetooth_device_connect(
|
||||||
self,
|
self,
|
||||||
address: int,
|
address: int,
|
||||||
on_bluetooth_connection_state: Callable[[bool, int], None],
|
on_bluetooth_connection_state: Callable[[bool, int, int], None],
|
||||||
on_bluetooth_connection_failed: Callable[[], None],
|
|
||||||
timeout: float = 10.0,
|
timeout: float = 10.0,
|
||||||
) -> Callable[[], None]:
|
) -> Callable[[], None]:
|
||||||
self._check_authenticated()
|
self._check_authenticated()
|
||||||
@ -458,9 +457,7 @@ class APIClient:
|
|||||||
if isinstance(msg, BluetoothDeviceConnectionResponse):
|
if isinstance(msg, BluetoothDeviceConnectionResponse):
|
||||||
resp = BluetoothDeviceConnection.from_pb(msg)
|
resp = BluetoothDeviceConnection.from_pb(msg)
|
||||||
if address == resp.address:
|
if address == resp.address:
|
||||||
on_bluetooth_connection_state(resp.connected, resp.mtu)
|
on_bluetooth_connection_state(resp.connected, resp.mtu, resp.error)
|
||||||
if resp.failed:
|
|
||||||
on_bluetooth_connection_failed()
|
|
||||||
|
|
||||||
assert self._connection is not None
|
assert self._connection is not None
|
||||||
await self._connection.send_message_callback_response(
|
await self._connection.send_message_callback_response(
|
||||||
|
@ -804,7 +804,7 @@ class BluetoothDeviceConnection(APIModelBase):
|
|||||||
address: int = 0
|
address: int = 0
|
||||||
connected: bool = False
|
connected: bool = False
|
||||||
mtu: int = 0
|
mtu: int = 0
|
||||||
failed: bool = False
|
error: int = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user