Feat/tuyaopen auth#34
Merged
shiliu-yang merged 17 commits intomasterfrom Apr 17, 2026
Merged
Conversation
Implement TuyaOpen device authorization via serial commands: - auth_protocol: serial command send/receive (read_mac, auth-read, auth write) - excel_parser: read/write authorization code Excel files with file locking - auth_handler: core authorization flow with retry, read-back verify, and log - auth_ui: GUI mixin with background workers for non-blocking serial I/O - Add Auth tab to ui_main.ui with config, status, progress, and log panels - Restore missing SerDebug pushButtonSDDump3/Dump4 lost during .ui edit - Add openpyxl dependency to requirements.txt Made-with: Cursor
- Fix Windows compatibility: replace fcntl with conditional import (msvcrt) - Fix GUI freeze: wrap AuthWorker.run() in try/except to always emit signal - Fix file handle leak: wrap authorize_single() body in try/finally - Fix slow response: add idle_timeout to _read_response for early return - Fix thread cleanup: add auth workers to _wait_threads() - Fix progress bar: use busy mode (indeterminate) during authorization - Fix SerDebug button text: restore original KWS/VAD channel labels - Fix mask_authkey: mask short authkeys, fix AuthLogger null safety - Remove duplicate command logs and unused import Made-with: Cursor
Strip ANSI escapes, discard device log lines and shell prompts from auth responses; detect Excel columns by header aliases instead of hardcoded indices and create .bak backup before writing. Made-with: Cursor
Avoid overwriting "already authorized" label with generic "success" when the worker finishes on a previously authorized device. Made-with: Cursor
Create a .bak copy of the authorization Excel before any write operations to prevent data loss from unexpected errors. Made-with: Cursor
Made-with: Cursor
…ation - Add retry mechanism for MAC reading (up to MAX_RETRIES) - Add on_confirm callback for user-driven conflict resolution - Implement find_by_mac() in excel_parser for cross-validation - Detect auth mismatch when device UUID/AUTHKEY differs from Excel record - Detect unknown batch when MAC not found in Excel - Show confirmation dialogs (Yes/No/Copy) for user to decide override or skip - Convert confirmation messages to English, remove AUTHKEY masking in dialogs - Add confirm_signal and thread-safe event handling in AuthWorker - Update status display for skipped/auth_mismatch states - Enhance QMessageBox with Copy button for dialog text Made-with: Cursor
Made-with: Cursor
Place About as a corner widget on the menubar and set AA_DontUseNativeMenuBar on Linux so the control is not hidden by global menu export. Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
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.
No description provided.