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