Home Assistant fixes and improvements (Claude-code assisted)#30
Open
andreaippo wants to merge 19 commits into
Open
Home Assistant fixes and improvements (Claude-code assisted)#30andreaippo wants to merge 19 commits into
andreaippo wants to merge 19 commits into
Conversation
dasimon135
added a commit
to dasimon135/pymadoka
that referenced
this pull request
Jun 27, 2026
… PR mduran80#30) Integrates Andrea Ippolito's Home Assistant improvements on top of the EyeBrightness feature: - fix bleak 'discover' import removed in bleak 0.20 (discover = BleakScanner.discover) - optional, lazily-imported HA path via bleak_retry_connector (hass=None keeps the standalone/CLI path working) - connection resilience: _is_starting reentrancy guard, conditional reconnect, safer cleanup, exponential backoff - per-operation asyncio.Lock + 10s wait_for timeout in Feature.query/update - Controller(address, ..., hass=None, name=None) new signature - eye_brightness feature preserved and wired into Controller - bump version 0.2.15 -> 0.2.16 Co-Authored-By: Andrea Ippolito <andreaippo@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This reverts commit 9d0a80a.
This reverts commit 26cd167.
This reverts commit 130859f.
Harden BLE resilience without changing any public interface (drop-in): - feature: short per-attempt command timeout + bounded retries instead of a single 10s wait, so lost responses recover fast and latency stays low. - connection: fix response-queue desync/leak on timeout; add a time-bounded stale-response guard so a delayed reply to a timed-out command cannot be mis-matched to the next command sharing its id; fail in-flight requests immediately on disconnect; exponential reconnect backoff on all paths; shorter escalating GATT write-retry backoff. - transport: length-based message reassembly (fixes 19-vs-20 chunk-count mismatch that could complete a truncated message) + duplicate-chunk guard. - consts: expose resilience/latency tuning knobs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Hi @mduran80 ,
I have stumbled on https://github.com/dasimon135/daikin_madoka which relies on your work, and I'm grateful to both you and dasimon135 for that, as I'm finally able to integrate my Madoka bluetooth thermostat in the latest version of Home Assistant.
It didn't work out of the box, however. The
daikin_madokarepo documents an incompability between thebleakversion referenced by the library and the one provided by the HA runtime.I'm not a python dev, so please forgive if some terms are incorrect here - I hope my point came across nevertheless.
I created personal forks of both repos just for the sake of trying to make things work with the latest version of Home Assistant, and with some help from Claude Code, got the library to work (as far as my limited testing can tell) with a usage of
bleakthat is compatible with Home Assistant's expectations.My forks are meant to be ephemeral: my idea from the start was to submit all changes upstream as soon as I got something working, so that the entire smart home community can benefit from them - just like intended by you and dasimon135.
So, kindly review these changes (Claude/Gemini assisted, since I'm proficient in Java) and consider them for merging.
Thanks!
P.S. I apologize for the scarce commit message hygiene - I was just rushing towards making everything work in Home Assistant. I leave it to you to choose a meaningful merge commit message.
Thanks again for your work! :)