Skip to content

Commit

Permalink
Fix BLE writes timing out (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 6, 2022
1 parent 088cbe9 commit dbfff43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions aioesphomeapi/client.py
Expand Up @@ -531,7 +531,7 @@ def unsub() -> None:
# to avoid race were we run out even though we have a slot.
await self.bluetooth_device_disconnect(address)
raise TimeoutAPIError(
f"Timeout waiting for connect response while connecting to {to_human_readable_address(address)}"
f"Timeout waiting for connect response while connecting to {to_human_readable_address(address)} after {timeout}s"
) from err

return unsub
Expand Down Expand Up @@ -613,7 +613,7 @@ async def bluetooth_gatt_write(
handle: int,
data: bytes,
response: bool,
timeout: float = 10.0,
timeout: float = DEFAULT_BLE_TIMEOUT,
) -> None:
req = BluetoothGATTWriteRequest()
req.address = address
Expand Down Expand Up @@ -656,7 +656,7 @@ async def bluetooth_gatt_write_descriptor(
address: int,
handle: int,
data: bytes,
timeout: float = 10.0,
timeout: float = DEFAULT_BLE_TIMEOUT,
) -> None:
req = BluetoothGATTWriteDescriptorRequest()
req.address = address
Expand Down
2 changes: 1 addition & 1 deletion aioesphomeapi/connection.py
Expand Up @@ -469,7 +469,7 @@ def on_read_exception(exc: Exception) -> None:
await fut
except asyncio.TimeoutError as err:
raise TimeoutAPIError(
f"Timeout waiting for response for {type(send_msg)}"
f"Timeout waiting for response for {type(send_msg)} after {timeout}s"
) from err
finally:
with suppress(ValueError):
Expand Down

0 comments on commit dbfff43

Please sign in to comment.