Repository navigation
Allow HTTPS-only control and refresh state after portal commands - #96
Draft
scheffield wants to merge 2 commits into
Draft
scheffield wants to merge 2 commits into
scheffield wants to merge 2 commits into
Conversation
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.
When the command socket is unavailable, each command first retries TCP before falling back to HTTPS. Add
use_tcp=Falseto select portal commands directly, while preserving the default TCP-first behavior and the existing read-only meaning ofuse_socket=False.Keep portal login cookies and reuse connections for consecutive requests, with a three-second idle timeout to avoid stale connections. Successful portal commands schedule one status refresh three seconds after the last accepted write, allowing cloud state to settle without blocking command completion.
Validation: 108 tests pass, including real HTTP tests for login retention, connection reuse and expiry; Ruff checks and formatting pass; Pylint scores 10/10. Live office tests confirmed and restored the setpoint without command-socket attempts. Reuse reduced consecutive command acceptance from approximately 1.95 s to 1.33 s. The original default pool reproduced
ServerDisconnectedErrorafter 4.7 s idle; the bounded pool passed the same gap and longer gaps. Command acceptance is distinct from status confirmation.