Repository navigation
Recover from stuck GATT operations and require HA 2026.6 (bleak 3) - #25
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Only remove a device from BlueZ after a GATT timeout. An ESPHome proxy does not keep stuck operations, so it keeps its bond and is only disconnected and connected again. - Point the stuck connection troubleshooting at the host (BlueZ) or the proxy instead of the Blanco Unit. - Run the workflows for pull requests into any branch, so pull requests stacked on another one are checked too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 6 tasks
github-actions Bot
pushed a commit
to alexhaller/blanco_unit
that referenced
this pull request
Nov 9, 2026
## [2.0.2](v2.0.1...v2.0.2) (2026-11-09) ### Bug Fixes * harden the BLE connection against leaks and stuck GATT operations ([ef3c1fa](ef3c1fa)), closes [Nailik#24](https://github.com/alexhaller/blanco_unit/issues/24) [Nailik#25](https://github.com/alexhaller/blanco_unit/issues/25) [Nailik#27](https://github.com/alexhaller/blanco_unit/issues/27) * point the documentation and issue links at this repository ([d423f16](d423f16)), closes [hacs/default#13647](hacs/default#13647) * stop reporting the filter and CO2 capacity as a battery ([5311f42](5311f42))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recovers from GATT operations that BlueZ never completes, makes reads and writes more tolerant of a busy device, and moves the minimum Home Assistant version to 2026.6 (bleak 3).
Stuck GATT recovery
GATT_TIMEOUT). One that does not finish raisesBlancoUnitGattTimeoutErrorinstead of hanging forever.establish_validated_connection). Through an ESPHome Bluetooth proxy, which does not keep stuck operations, the connection is only closed and opened again, so the proxy keeps its bond (decided byBleakClient.backend_id). This is used for setup, the config flow and the runtime client.pair=True), which BlueZ needs for service discovery.Read / write robustness
MAX_READ_ERRORS, instead of ending the read loop on the first one. Writes are followed by a short delay so the device can prepare its response.PREPARE_QUEUE_FULL,UNLIKELY_ERROR,INSUFFICIENT_RESOURCE,PROCEDURE_ALREADY_IN_PROGRESS. Permanent rejections and lost links still fail on the first attempt. This retry only applies on a local BlueZ adapter: bleak-esphome reports GATT errors from a proxy as a plainBleakError, without an ATT error code.IndexErrorwhen the packet count is read.attempts,empty_reads,duplicate_readsandread_errorsin itsTimeoutError.CI
main, so pull requests stacked on this one are checked too.Logging
Home Assistant 2026.6 / bleak 3 (breaking)
MIN_HA_VERSIONandhacs.jsonmove to 2026.6.0, the first release that ships bleak 3. The busy-write retry relies on bleak 3'sBleakGATTProtocolError.manifest.jsonno longer requiresbleak>=0.21.1. HA's bluetooth integration provides it.homeassistant==2026.6.0with the matchingpytest-homeassistant-custom-component==0.13.336on Python 3.14. The usb integration's test-only requirements follow HA (serialx, aioesphomeapi).aliasesis a list, newobject_id_base). Entity ids, unique ids, names, states and units are unchanged.README
Breaking change
Requires Home Assistant 2026.6.0 or newer.
Test plan
pytest tests: 375 passed, 68 snapshots passed (Python 3.14.2, HA 2026.6.0, bleak 3.0.2)ruff check/ruff format --checkon the changed code🤖 Generated with Claude Code