Skip to content

Log the idle WiiM "Failed" metainfo answer at debug level - #139

Closed
ccristal wants to merge 1 commit into
velbus:mainfrom
ccristal:fix/metainfo-failed-log
Closed

ccristal wants to merge 1 commit into
velbus:mainfrom
ccristal:fix/metainfo-failed-log

Conversation

@ccristal

@ccristal ccristal commented Oct 19, 2026 •

Copy link
Copy Markdown

When nothing is loaded, a WiiM answers getMetaInfo with plain-text Failed. Since #93 the player treats that as empty meta info, but session_call_api_json still logs Unexpected json for .../getMetaInfo: Expecting value: line 1 column 1 (char 0) as a warning first. With Home Assistant polling every 5 s, a WiiM Pro left idle after its overnight restart logged 2,625 of these warnings between 03:11 and 06:50, stopping as soon as playback started.

Change

  • session_call_api_json logs the Failed answer at debug level. Any other invalid JSON is still a warning, and the exception raised is unchanged.
  • test_meta_info_failed_handling now also checks that no warning is logged; that assertion fails without the fix.

Testing

  • pytest: 290 passed, 1 skipped.
  • Ruff could not be run locally; relying on CI.

🤖 Generated with Claude Code

WiiM devices answer getMetaInfo with plain-text "Failed" when nothing is
loaded. The player already treats that as empty metainfo, but the JSON
helper logged a warning on every poll (thousands overnight while idle).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DBuBhcANHioWShtwB1sTxq
ccristal added a commit to ccristal/python-linkplay that referenced this pull request Oct 19, 2026
Moved to its own PR (velbus#139), as it is a separate problem.

This reverts commit df982f4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DBuBhcANHioWShtwB1sTxq
@ccristal

Copy link
Copy Markdown
Author

Closing as a duplicate of #129, which makes the same change and also handles empty responses. I've added my reproduction details there.

@ccristal ccristal closed this Oct 19, 2026
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