Skip to content

Wiim (only?): httpapi call error with getMetaInfo, likely when Wiim is asleep #91

Description

@vingerha

The recently introduced call to collect MetaInfo (e.g. for the picture/url) is crashing likely when the device is not active
https://IP/httpapi.asp?command=getMetaInfo throws back 'Failed' in a certain case, assumingly when the WiiM is asleep. I can not reproduce it easily as there is no manual way to put the WiiM to this state (if it is even a state in sleep)
Error is thrown as the return is no json

...
File "/usr/local/lib/python3.13/site-packages/linkplay/bridge.py", line 158, in update_status

    ] = await self.bridge.json_request(LinkPlayCommand.META_INFO)  # type: ignore[assignment]

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.13/site-packages/linkplay/bridge.py", line 487, in json_request

    response = await self.endpoint.json_request(command)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.13/site-packages/linkplay/endpoint.py", line 58, in json_request

    return await session_call_api_json(self._endpoint, self._session, command)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.13/site-packages/linkplay/utils.py", line 84, in session_call_api_json

    raise LinkPlayInvalidDataException(

        f"Unexpected JSON ({result}) received from '{url}'"

    ) from jsonexc

linkplay.exceptions.LinkPlayInvalidDataException: Unexpected JSON (Failed) received from 'https://IP/httpapi.asp?command=getMetaInfo'

When playing something to the WiiM, or hour(s) afer that, all is fine. No clue when WiiM enters the state that throws the error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions