mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Extend Sonos queue operation timeouts (#80804)
This commit is contained in:
parent
f977b264a1
commit
d50f5e49c8
@ -438,7 +438,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||||||
soco.play_uri(uri, title=favorite.title)
|
soco.play_uri(uri, title=favorite.title)
|
||||||
else:
|
else:
|
||||||
soco.clear_queue()
|
soco.clear_queue()
|
||||||
soco.add_to_queue(favorite.reference)
|
soco.add_to_queue(favorite.reference, timeout=LONG_SERVICE_TIMEOUT)
|
||||||
soco.play_from_queue(0)
|
soco.play_from_queue(0)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -586,13 +586,15 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||||||
media_id = async_process_play_media_url(self.hass, media_id)
|
media_id = async_process_play_media_url(self.hass, media_id)
|
||||||
|
|
||||||
if enqueue == MediaPlayerEnqueue.ADD:
|
if enqueue == MediaPlayerEnqueue.ADD:
|
||||||
soco.add_uri_to_queue(media_id)
|
soco.add_uri_to_queue(media_id, timeout=LONG_SERVICE_TIMEOUT)
|
||||||
elif enqueue in (
|
elif enqueue in (
|
||||||
MediaPlayerEnqueue.NEXT,
|
MediaPlayerEnqueue.NEXT,
|
||||||
MediaPlayerEnqueue.PLAY,
|
MediaPlayerEnqueue.PLAY,
|
||||||
):
|
):
|
||||||
pos = (self.media.queue_position or 0) + 1
|
pos = (self.media.queue_position or 0) + 1
|
||||||
new_pos = soco.add_uri_to_queue(media_id, position=pos)
|
new_pos = soco.add_uri_to_queue(
|
||||||
|
media_id, position=pos, timeout=LONG_SERVICE_TIMEOUT
|
||||||
|
)
|
||||||
if enqueue == MediaPlayerEnqueue.PLAY:
|
if enqueue == MediaPlayerEnqueue.PLAY:
|
||||||
soco.play_from_queue(new_pos - 1)
|
soco.play_from_queue(new_pos - 1)
|
||||||
elif enqueue == MediaPlayerEnqueue.REPLACE:
|
elif enqueue == MediaPlayerEnqueue.REPLACE:
|
||||||
@ -609,7 +611,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||||||
_LOGGER.error('Could not find a Sonos playlist named "%s"', media_id)
|
_LOGGER.error('Could not find a Sonos playlist named "%s"', media_id)
|
||||||
else:
|
else:
|
||||||
soco.clear_queue()
|
soco.clear_queue()
|
||||||
soco.add_to_queue(playlist)
|
soco.add_to_queue(playlist, timeout=LONG_SERVICE_TIMEOUT)
|
||||||
soco.play_from_queue(0)
|
soco.play_from_queue(0)
|
||||||
elif media_type in PLAYABLE_MEDIA_TYPES:
|
elif media_type in PLAYABLE_MEDIA_TYPES:
|
||||||
item = media_browser.get_media(self.media.library, media_id, media_type)
|
item = media_browser.get_media(self.media.library, media_id, media_type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user