Skip to content

Commit

Permalink
Implement getitem in client players class
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Oct 25, 2024
1 parent 29f28e8 commit f3c2b1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions music_assistant/client/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def get(self, player_id: str) -> Player | None:
"""Return Player by ID (or None if not found)."""
return self._players.get(player_id)

def __getitem__(self, player_id: str) -> Player:
"""Return Player by ID."""
return self._players[player_id]

# Player related endpoints/commands

async def player_command_stop(self, player_id: str) -> None:
Expand Down

0 comments on commit f3c2b1b

Please sign in to comment.