Skip to content

Commit

Permalink
fix: handle Dbus closing the connection on us (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Sep 9, 2022
1 parent c93c0c1 commit 847698f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bluetooth_adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ async def _get_dbus_managed_objects() -> dict[str, Any]:
try:
async with async_timeout.timeout(REPLY_TIMEOUT):
reply = await bus.call(msg)
except EOFError as ex:
_LOGGER.debug("DBus connection closed: %s", ex)
return {}
except asyncio.TimeoutError:
_LOGGER.debug(
"Dbus timeout waiting for reply to GetManagedObjects; try restarting "
Expand Down

0 comments on commit 847698f

Please sign in to comment.