Fix the issues found in the review of 1.0.0 - #6
Merged
Merged
Conversation
I had 1.0.0 reviewed by an outside party before asking Home Assistant to switch to it. The review confirmed the library talks to devices exactly the way the original did, and found one real bug plus a few small things. This fixes them. No change to the wire format or the public API. Tested on Python 3.13 and 3.14 (252 tests) and live against an RM4 Pro. Technical details: - Replies are matched to their request by the packet counter the device echoes at offset 0x28. A reply for a request that already timed out is dropped; a reply whose counter matches nothing sent is still accepted, so firmware that does not echo the counter keeps working. - Concurrent callers hitting an expired session key share one re-authentication. The logged-out code (-2) now triggers re-auth. - Changing device.host reopens the socket. - aclose() during a request fails it immediately. - capture() treats ReadError (-10) as "nothing yet" alongside StorageError (-5); the CLI inherits this. - An abandoned capture() generator no longer blocks the next one; new capture_active property. - README: broadlink and python-broadlink cannot share an environment. - Changelog: carried-over device commits were squash-merged with Co-authored-by credit; oracle description corrected. - Version 1.0.1.
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.
I had 1.0.0 reviewed by an outside party before asking Home Assistant to switch to it. The review confirmed the library talks to devices like the original does.
They also mentioned that the new version keeps one network socket open per device, a slow reply to an old request could get mistaken for the reply to a new one. Poor connectivity could show up as a wrong sensor reading or state.
We think we fixed it after confirming on bench hardware. Tested on Python 3.13 and 3.14, 252 tests, plus a live run against an RM4 Pro.
Coding assistant's notes on this change: