Skip to content

Commit 0b7f49e

Browse files
committed
aioble/device.py: No default timeout for async disconnected() method.
The value for the `timeout_ms` optional argument to `DeviceConnection.disconnected()` async method is changed from 60000 to None. This way users awaiting a device disconnection using `await connection.disconnected()` won't be surprised by a 1 minute timeout. For instance, in the `temp_sensor.py` usage example I think it's reasonable to expect the connection to the client to stay open indefinitely. Signed-off-by: Rob Knegjens <rob@knegjens.net>
1 parent 0c31e0b commit 0b7f49e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

micropython/bluetooth/aioble/aioble/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def _run_task(self):
215215
async def disconnect(self, timeout_ms=2000):
216216
await self.disconnected(timeout_ms, disconnect=True)
217217

218-
async def disconnected(self, timeout_ms=60000, disconnect=False):
218+
async def disconnected(self, timeout_ms=None, disconnect=False):
219219
if not self.is_connected():
220220
return
221221

0 commit comments

Comments
 (0)