Skip to content

Commit

Permalink
Allow dynamic max preset in linkplay play preset (home-assistant#130160)
Browse files Browse the repository at this point in the history
  • Loading branch information
silamon authored and frenck committed Nov 15, 2024
1 parent b27e0f9 commit 32dc9fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion homeassistant/components/linkplay/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ async def async_play_media(
@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:
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/linkplay/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ play_preset:
selector:
number:
min: 1
max: 10
mode: box

0 comments on commit 32dc9fc

Please sign in to comment.