Allow dynamic max preset in linkplay play preset (#130160)

This commit is contained in:
Simon Lamon 2024-11-10 12:02:55 +01:00 committed by Franck Nijhof
parent b27e0f9fe7
commit 32dc9fc238
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 4 additions and 2 deletions

View File

@ -292,7 +292,10 @@ class LinkPlayMediaPlayerEntity(MediaPlayerEntity):
@exception_wrap
async def async_play_preset(self, preset_number: int) -> None:
"""Play preset number."""
await self._bridge.player.play_preset(preset_number)
try:
await self._bridge.player.play_preset(preset_number)
except ValueError as err:
raise HomeAssistantError(err) from err
@exception_wrap
async def async_join_players(self, group_members: list[str]) -> None:

View File

@ -11,5 +11,4 @@ play_preset:
selector:
number:
min: 1
max: 10
mode: box