Bluetooth-Devices
bleak-esphome
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
chore(pre-commit.ci): pre-commit autoupdate updates: - [github.com/commitizen-tools/commitizen: v4.13.9 → v4.13.10](https://github.com/commitizen-tools/commitizen/compare/v4.13.9...v4.13.10) - [github.com/astral-sh/ruff-pre-commit: v0.15.9 → v0.15.11](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.9...v0.15.11) - [github.com/pre-commit/mirrors-mypy: v1.20.0 → v1.20.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.0...v1.20.1)
pre-commit-ci-update-config
3 days ago
chore(pre-commit.ci): pre-commit autoupdate updates: - [github.com/commitizen-tools/commitizen: v4.13.9 → v4.13.10](https://github.com/commitizen-tools/commitizen/compare/v4.13.9...v4.13.10) - [github.com/astral-sh/ruff-pre-commit: v0.15.9 → v0.15.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.9...v0.15.10) - [github.com/pre-commit/mirrors-mypy: v1.20.0 → v1.20.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.0...v1.20.1)
pre-commit-ci-update-config
10 days ago
fix: shield disconnect cleanup in connect cancel handler (#288)
main
12 days ago
fix: shield disconnect cleanup in connect cancel handler When `_get_services` raises `CancelledError` during `connect()`, the cancel handler runs `await self._disconnect()` to release the BLE connection on the ESP side. The previous code wrapped the disconnect in `contextlib.suppress(Exception)` which does NOT catch `CancelledError`, so a parent-task re-cancellation arriving while the disconnect was in flight would interrupt it half-way and skip the bare `raise` after the suppress, leaving the device potentially still connected on the ESP side and propagating the new `CancelledError` instead of the original. Wrap the disconnect in `asyncio.shield(disconnect_task)` so a re-cancellation cannot interrupt it. If a re-cancel does arrive, finish awaiting the disconnect task before re-raising so the cancellation still propagates to the caller. The original `except Exception` (ignore disconnect failure) behavior is preserved via the outer `contextlib.suppress(Exception)`. Adds a strict regression test that fails without the shield (the slow `_disconnect` mock's `disconnect_finished` event remains unset because the await is interrupted) and passes with it.
fix-get-services-cleanup-shield
12 days ago
fix: convert spurious CancelledError in connect to BleakError (#286)
main
12 days ago
fix: convert spurious cancellation in APIConnectionManager.start to ESPHomeStartAborted (#287)
main
12 days ago
fix: also clean up connection-state subscription on real cancel path Previously the cleanup of `_cancel_connection_state` only ran in the spurious-cancel branch (where we convert `CancelledError` to `BleakError`). On a genuine task cancellation we propagated `CancelledError` via `raise` without invoking the subscription cleanup, leaving the subscription registered until `__del__` ran and warned about the bleak client not being properly disconnected before destruction. Move the cleanup above the `cancelling()` check so it runs in both branches, and update the real-cancel-outer regression test to assert the cleanup ran.
fix-connect-cancellation-leak
12 days ago
refactor: rename StartAborted to ESPHomeStartAborted The exception is exported from the bleak_esphome top-level package so it should be self-describing. `StartAborted` reads ambiguously in that namespace; `ESPHomeStartAborted` makes it clear what is being aborted.
fix-connection-manager-spurious-cancel
12 days ago
Latest Branches
CodSpeed Performance Gauge
+1%
chore(pre-commit.ci): pre-commit autoupdate
#289
3 days ago
167ba48
pre-commit-ci-update-config
CodSpeed Performance Gauge
0%
fix: shield disconnect cleanup in connect cancel handler
#288
12 days ago
cc60dde
fix-get-services-cleanup-shield
CodSpeed Performance Gauge
0%
fix: convert spurious CancelledError in connect to BleakError
#286
12 days ago
6f24890
fix-connect-cancellation-leak
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs