Don’t warn on expected WiiM getMetaInfo → Failed response
Summary
Follow-up to #91 / #93.
WiiM devices return the plain text Failed (HTTP 200, not JSON) for getMetaInfo when idle / no track metadata. While playing, the same endpoint returns normal JSON (metaData with title/artist/art, etc.).
#93 correctly handles this in bridge.py by catching LinkPlayInvalidDataException when exc.data == "Failed" and clearing metainfo. That prevents crashes — but session_call_api_json in utils.py still logs a warning before raising:
LOGGER.warning("Unexpected json for %s: %s", url, jsonexc)
In Home Assistant (local polling ~every 5s), an idle WiiM therefore spams:
WARNING [linkplay] Unexpected json for https://…/httpapi.asp?command=getMetaInfo: Expecting value: line 1 column 1 (char 0)
Once playback starts and getMetaInfo returns JSON again, the warnings stop.
Proposed change
Treat bare Failed as an expected non-JSON payload: keep raising LinkPlayInvalidDataException(data=result) so existing bridge handling still works, but log at debug (or skip logging) instead of warning when result == "Failed".
Still warn for other unexpected non-JSON responses.
Repro
- WiiM idle / stopped —
GET /httpapi.asp?command=getMetaInfo → Failed
- Start playback on the same device → valid JSON
metaData object
- Observe HA / linkplay logs: warning every poll while idle; quiet while playing
Tested on
- Device: WiiM Pro (firmware Linkplay.4.8.814756)
- Library: python-linkplay 0.2.14 (via Home Assistant 2026.7.4 after JUST upgrading to new HA container)
Note
#93 fixed the crash; this removes the residual log noise for the same expected WiiM idle response.
Don’t warn on expected WiiM
getMetaInfo→FailedresponseSummary
Follow-up to #91 / #93.
WiiM devices return the plain text
Failed(HTTP 200, not JSON) forgetMetaInfowhen idle / no track metadata. While playing, the same endpoint returns normal JSON (metaDatawith title/artist/art, etc.).#93 correctly handles this in
bridge.pyby catchingLinkPlayInvalidDataExceptionwhenexc.data == "Failed"and clearingmetainfo. That prevents crashes — butsession_call_api_jsoninutils.pystill logs a warning before raising:In Home Assistant (local polling ~every 5s), an idle WiiM therefore spams:
Once playback starts and
getMetaInforeturns JSON again, the warnings stop.Proposed change
Treat bare
Failedas an expected non-JSON payload: keep raisingLinkPlayInvalidDataException(data=result)so existing bridge handling still works, but log at debug (or skip logging) instead of warning whenresult == "Failed".Still warn for other unexpected non-JSON responses.
Repro
GET /httpapi.asp?command=getMetaInfo→FailedmetaDataobjectTested on
Note
#93 fixed the crash; this removes the residual log noise for the same expected WiiM idle response.