Skip to content

Recover ThinQ session after NotLoggedInError - #973

Draft
maxfok wants to merge 1 commit into
ollo69:masterfrom
maxfok:codex/recover-0102-session
Draft

Recover ThinQ session after NotLoggedInError#973
maxfok wants to merge 1 commit into
ollo69:masterfrom
maxfok:codex/recover-0102-session

Conversation

@maxfok

@maxfok maxfok commented Jun 1, 2026

Copy link
Copy Markdown

Summary

Recover the active ThinQ client/session immediately when LG returns NotLoggedInError during device polling.

Root cause

Some LG ThinQ API responses can start returning error 0102 / NotLoggedInError after the active session has been alive for a short time, even though the refresh token is still valid. The integration can refresh the client successfully, but the monitor currently treats the original polling failure as another critical login failure. Repeating this eventually trips _critical_error and stops updates.

Changes

  • Reload devices after a full client refresh so the newly-created session has a fresh device list.
  • When polling raises NotLoggedInError, mark the shared client disconnected, refresh it immediately, and retry the current monitor update.
  • Keep the critical failure counter behavior for real repeated login failures, but do not mark a successfully recoverable session refresh attempt as critical.

Validation

  • Ran targeted Python compile checks for the changed files.
  • Ran git diff --check.
  • Tested the change on a live Home Assistant installation with an LG washer that previously returned 0102 after about 10 minutes; the integration recovered and continued updating instead of entering critical error state.

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