B5r1oJ0A9G / teufel_raumfeld

Integration for Teufel smart speaker (aka Raumfeld Multiroom) into https://www.home-assistant.io/.
GNU General Public License v3.0
33 stars 7 forks source link

Plugin fails to work if speakers/groups are in Spotify Mode #68

Open theomega opened 4 months ago

theomega commented 4 months ago

The plugin seems to to be able to handle if the speakers/groups are currently in "Spotify" Mode. They can be in this mode because either spotify is currently streaming to them or if this was the last source for the speakers (even days ago)

How to reproduce:

Whats Working:

Check the Mediaplayer in Homeassistant and notice:

[140088570596512] Unexpected exception [140088441694544] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/teufel_raumfeld/media_player.py", line 553, in async_play_media await self._raumfeld.async_set_av_transport_uri( File "/usr/local/lib/python3.12/site-packages/hassfeld/init.py", line 767, in async_set_av_transport_uri zone_loc = self.resolve["udn_to_devloc"][zone_udn]


KeyError: None
```

This is exactly the same error as #56, so I assume the person issuing this bug had his player as well in Spotify mode. The same error can be triggered if picking the "Media" Menu Item from the Sidebar of HA and then picking the Raumfeld Group als Player and Navigating to a file and trying to play it.

All three issues go away if you use the Raumfeld Mobile App to first play a local song from your storage. Then the Mediaplayer and everything starts to work again.

I assume the Raumfeld devices are somehow in a different state if Spotify is or was currently planning. This might explain some other bug reports.