Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbus-next backend: write_gatt_char on closed connection raises AttributeError. Expect BleakError. #426

Closed
devbis opened this issue Jan 17, 2021 · 0 comments · Fixed by #389
Assignees
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend

Comments

@devbis
Copy link
Contributor

devbis commented Jan 17, 2021

  • bleak version: snapshot, dbus-next-2 branch
  • Python version: 3.7
  • Operating System: OpenWrt
  • BlueZ version: 5.54

Description

When Bluetooth device is disconnected and my code still tries to execute write_gatt_char() it raises AttributeError unexpectedly. I suppose it should be reraised with BleakError type.

Sun Jan 17 22:11:28 2021 daemon.err ble2mqtt[1371]:   File "/usr/lib/python3.7/site-packages/bleak-0.11.0a1-py3.7.egg/bleak/backends/bluezdbus/client.py", line 768, in write_gatt_char
Sun Jan 17 22:11:28 2021 daemon.err ble2mqtt[1371]:     reply = await self._bus.call(
Sun Jan 17 22:11:28 2021 daemon.err ble2mqtt[1371]: AttributeError: 'NoneType' object has no attribute 'call'
@dlech dlech linked a pull request Mar 2, 2021 that will close this issue
@dlech dlech added the Backend: BlueZ Issues and PRs relating to the BlueZ backend label Mar 2, 2021
@dlech dlech self-assigned this Mar 2, 2021
@dlech dlech closed this as completed in #389 Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants