Skip to content

Small items from the review of 1.0.5 - #11

Merged
DAB-LABS merged 1 commit into
masterfrom
fixes-1.0.6
Sep 6, 2026
Merged

Small items from the review of 1.0.5#11
DAB-LABS merged 1 commit into
masterfrom
fixes-1.0.6

Conversation

@DAB-LABS

@DAB-LABS DAB-LABS commented Sep 6, 2026

Copy link
Copy Markdown
Owner

The sixth review found nothing wrong in the code, so this is a tidy-up round. The one behaviour change is small: if the device says the session key has expired and the library's attempt to log in again then times out, the caller now sees the timeout instead of the device's original message, which is what actually happened.

The rest is a Windows safeguard for the discovery socket, an honest rewording of the RM Max note (the mapping comes from an upstream pull request whose testers reported the device answering "locked", so it is listed as reported rather than confirmed), a log level, and one loop closed the same way as its sibling.

Tested on Python 3.13 and 3.14, 274 tests, plus a live run against an RM4 Pro.

Coding assistant's notes on this change:

NetworkTimeoutError and EndpointClosedError raised during the library's own re-authentication now propagate; other BroadlinkExceptions still return the request's original reply as before, so a locked device still surfaces as AuthorizationError for the caller's own reauth flow. _open_endpoint binds to ("0.0.0.0", 0) when neither address is given, for the proactor loop on Windows. The RM Max comment and the 1.0.0 changelog entry say only what upstream mjg59#838 showed. The undecodable-capture message is debug rather than warning, since the window re-arms by itself, and _capture_rf_loop closes its inner generator with aclosing like the IR loop. Typing, py.typed and the CLI move remain deferred on purpose.

A sixth review, of 1.0.5, found no defect in the code. This takes its small
items. No change to the wire format or the public API. Tested on 3.13 and
3.14, 274 tests under -X dev with ResourceWarning as an error, oracle
fixtures unchanged, and live against an RM4 Pro.

Technical details:
- A NetworkTimeoutError or EndpointClosedError during the library's own
  re-authentication propagates instead of being swallowed in favour of
  the device's original expired-key reply, so a network failure is
  reported as one.
- _open_endpoint binds to ("0.0.0.0", 0) when neither address is given
  (discovery, ping, setup), for the proactor loop on Windows.
- The RM Max comment and the 1.0.0 changelog entry say only what upstream
  mjg59#838 showed: mapping per its diff, testers reported "locked" on auth,
  listed as reported rather than confirmed.
- The undecodable-capture message is debug, not warning.
- _capture_rf_loop closes its inner generator with aclosing.
- Version 1.0.6.
@DAB-LABS
DAB-LABS merged commit 72f51b8 into master Sep 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant