From 652e30c56dea4e140d434aeff17d624863891e6c Mon Sep 17 00:00:00 2001 From: Santiago Soto Date: Wed, 2 Apr 2025 19:10:17 -0300 Subject: [PATCH] Implement remove_player --- music_assistant/providers/snapcast/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/music_assistant/providers/snapcast/__init__.py b/music_assistant/providers/snapcast/__init__.py index 52393744..8ffda1f5 100644 --- a/music_assistant/providers/snapcast/__init__.py +++ b/music_assistant/providers/snapcast/__init__.py @@ -291,7 +291,7 @@ class SnapCastProvider(PlayerProvider): @property def supported_features(self) -> set[ProviderFeature]: """Return the features supported by this Provider.""" - return {ProviderFeature.SYNC_PLAYERS} + return {ProviderFeature.SYNC_PLAYERS, ProviderFeature.REMOVE_PLAYER} async def handle_async_init(self) -> None: """Handle async initialization of the provider.""" @@ -444,6 +444,10 @@ class SnapCastProvider(PlayerProvider): CONF_ENTRY_OUTPUT_CODEC_HIDDEN, ) + async def remove_player(self, player_id: str) -> None: + """Remove the client from the snapserver when it is deleted.""" + self.mass.create_task(self._snapserver.delete_client(self._get_snapclient_id(player_id))) + async def cmd_volume_set(self, player_id: str, volume_level: int) -> None: """Send VOLUME_SET command to given player.""" snap_client_id = self._get_snapclient_id(player_id) -- 2.34.1