home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.62k stars 29.93k forks source link

LinkPlay media player stuck in `unknown` state #123051

Closed nagyrobi closed 1 month ago

nagyrobi commented 1 month ago

The problem

Testing the new https://github.com/home-assistant/core/pull/113940 integration. The player was detected but it's stuck in unknown state.

What version of Home Assistant Core has the issue?

core-2024.8.0b0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

linkplay

Link to integration documentation on our website

https://rc.home-assistant.io/integrations/linkplay/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-08-02 10:27:30.570 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.ebedlo fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 113, in _wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 158, in async_update
    self._update_properties()
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 234, in _update_properties
    self._attr_repeat = REPEAT_MAP[self._bridge.player.loop_mode]
                        ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: <LoopMode.FOUR: '4'>

Additional information

Works fine with the old custom component.

home-assistant[bot] commented 1 month ago

Hey there @velleman, mind taking a look at this issue as it has been labeled with an integration (linkplay) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `linkplay` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign linkplay` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


linkplay documentation linkplay source (message by IssueLinks)

nagyrobi commented 1 month ago

@dukeofphilberg

dukeofphilberg commented 1 month ago

@nagyrobi Seems like LoopMode.FOUR is unmapped in REPEAT_MAP. Do you happen to know what type of loop it is doing?

nagyrobi commented 1 month ago

See list at: https://developer.arylic.com/httpapi/#playback-status

loop  Is a Combination of SHUFFLE and REPEAT modes
0: SHUFFLE: disabled REPEAT: enabled - loop
1: SHUFFLE: disabled REPEAT: enabled - loop once
2: SHUFFLE: enabled REPEAT: enabled - loop
3: SHUFFLE: enabled REPEAT: disabled
4: SHUFFLE: disabled REPEAT: disabled
5: SHUFFLE: enabled REPEAT: enabled - loop once
nagyrobi commented 1 month ago

I also find it very confusing to display unknown when the device is playing from a Line-In source. Should either display playing or something else meaningful.

nagyrobi commented 1 month ago

Also find some models here: https://github.com/home-assistant/core/pull/123056 (draft because I want to check some)

dukeofphilberg commented 1 month ago

Will be fixed after #123062 and #123063 merge