From b52ee6915abfcd7cf24273d2d7dfd78902557d99 Mon Sep 17 00:00:00 2001 From: Tucker Kern Date: Mon, 13 Oct 2025 16:32:33 -0600 Subject: [PATCH] Make Snapcast snapshot action async (#153132) --- homeassistant/components/snapcast/media_player.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/snapcast/media_player.py b/homeassistant/components/snapcast/media_player.py index ccb9d4c4c46..e99be58c7cc 100644 --- a/homeassistant/components/snapcast/media_player.py +++ b/homeassistant/components/snapcast/media_player.py @@ -65,7 +65,7 @@ def register_services() -> None: """Register snapcast services.""" platform = entity_platform.async_get_current_platform() - platform.async_register_entity_service(SERVICE_SNAPSHOT, None, "snapshot") + platform.async_register_entity_service(SERVICE_SNAPSHOT, None, "async_snapshot") platform.async_register_entity_service(SERVICE_RESTORE, None, "async_restore") platform.async_register_entity_service( SERVICE_JOIN, {vol.Required(ATTR_MASTER): cv.entity_id}, "async_join" @@ -250,7 +250,7 @@ class SnapcastBaseDevice(SnapcastCoordinatorEntity, MediaPlayerEntity): await self._device.set_volume(round(volume * 100)) self.async_write_ha_state() - def snapshot(self) -> None: + async def async_snapshot(self) -> None: """Snapshot the group state.""" self._device.snapshot() @@ -428,12 +428,12 @@ class SnapcastGroupDevice(SnapcastBaseDevice): await super().async_set_volume_level(volume) - def snapshot(self) -> None: + async def async_snapshot(self) -> None: """Snapshot the group state.""" # Groups are deprecated, create an issue when used self._async_create_group_deprecation_issue() - super().snapshot() + await super().async_snapshot() async def async_restore(self) -> None: """Restore the group state."""