fix(tuya): retry once on a stale persistent socket before reporting offline - #47
Merged
Merged
Conversation
…ffline The Tuya valve bridge polls each device over a persistent TinyTuya socket. Production logs show that socket returning "Unexpected Payload from Device" (Err 904) on roughly every second poll, right after a preceding successful poll on the same connection - a fresh reconnect always succeeds immediately after. poll_one previously treated any single failed poll as a hard offline flip, so this alternation showed up as the valve flapping online/offline every poll interval. Now a failed status() call reconnects and retries once in the same cycle before giving up. Co-Authored-By: Claude Sonnet 5 <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.
Squash-merge commit message
Summary
Checklist
(
type(scope): summary) and matches the style ingit log.CONTRIBUTING.md → Running the checks
pass locally (Python bridges, HA integration, Go dashboard, dashboard JS,
dashboard smoke test — whichever the change touches).
./scripts/deploy/check_tracked_secrets.shis clean — no realcredentials, private-range IPs, or device serials.
AI-DISCLAIMER.md.