1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 09:38:58 +01:00

Add HEOS entity service to remove queue items (#141495)

* Add remove queue items service

* Tests

* Correct casing of ID

* Match docs
This commit is contained in:
Andrew Sayre
2025-03-28 11:09:01 -05:00
committed by GitHub
parent 2121b943a3
commit ba00707d89
7 changed files with 63 additions and 0 deletions
+1
View File
@@ -43,6 +43,7 @@ class MockHeos(Heos):
self.player_play_previous: AsyncMock = AsyncMock()
self.player_play_queue: AsyncMock = AsyncMock()
self.player_play_quick_select: AsyncMock = AsyncMock()
self.player_remove_from_queue: AsyncMock = AsyncMock()
self.player_set_mute: AsyncMock = AsyncMock()
self.player_set_play_mode: AsyncMock = AsyncMock()
self.player_set_play_state: AsyncMock = AsyncMock()
@@ -27,11 +27,13 @@ from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.components.heos.const import (
ATTR_QUEUE_IDS,
DOMAIN,
SERVICE_GET_QUEUE,
SERVICE_GROUP_VOLUME_DOWN,
SERVICE_GROUP_VOLUME_SET,
SERVICE_GROUP_VOLUME_UP,
SERVICE_REMOVE_FROM_QUEUE,
)
from homeassistant.components.media_player import (
ATTR_GROUP_MEMBERS,
@@ -1767,3 +1769,18 @@ async def test_get_queue(
)
controller.player_get_queue.assert_called_once_with(1, None, None)
assert response == snapshot
async def test_remove_from_queue(
hass: HomeAssistant, config_entry: MockConfigEntry, controller: MockHeos
) -> None:
"""Test the get queue service."""
config_entry.add_to_hass(hass)
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.services.async_call(
DOMAIN,
SERVICE_REMOVE_FROM_QUEUE,
{ATTR_ENTITY_ID: "media_player.test_player", ATTR_QUEUE_IDS: [1, "2"]},
blocking=True,
)
controller.player_remove_from_queue.assert_called_once_with(1, [1, 2])