core/tests/components/squeezebox/test_button.py
peteS-UK e48a25e952
Add button platform for Squeezebox integration (#140697)
* initial

* trans key correction

* base class updates

* model tidy up

* Update homeassistant/components/squeezebox/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/squeezebox/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/squeezebox/button.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* review updates

* update

* move manufacturer to library

* updates

* list concat

* review updates

* Update tests/components/squeezebox/test_button.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-03-20 17:18:08 +01:00

24 lines
686 B
Python

"""Tests for the squeezebox button component."""
from unittest.mock import MagicMock
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant
async def test_squeezebox_press(
hass: HomeAssistant, configured_player_with_button: MagicMock
) -> None:
"""Test press service call."""
await hass.services.async_call(
BUTTON_DOMAIN,
SERVICE_PRESS,
{ATTR_ENTITY_ID: "button.test_player_preset_1"},
blocking=True,
)
configured_player_with_button.async_query.assert_called_with(
"button", "preset_1.single"
)