mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Add tests for the Plugwise Select platform (#75774)
This commit is contained in:
parent
184e254a43
commit
aaaca0b2bd
@ -927,7 +927,6 @@ omit =
|
|||||||
homeassistant/components/plex/cast.py
|
homeassistant/components/plex/cast.py
|
||||||
homeassistant/components/plex/media_player.py
|
homeassistant/components/plex/media_player.py
|
||||||
homeassistant/components/plex/view.py
|
homeassistant/components/plex/view.py
|
||||||
homeassistant/components/plugwise/select.py
|
|
||||||
homeassistant/components/plum_lightpad/light.py
|
homeassistant/components/plum_lightpad/light.py
|
||||||
homeassistant/components/pocketcasts/sensor.py
|
homeassistant/components/pocketcasts/sensor.py
|
||||||
homeassistant/components/point/__init__.py
|
homeassistant/components/point/__init__.py
|
||||||
|
44
tests/components/plugwise/test_select.py
Normal file
44
tests/components/plugwise/test_select.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
"""Tests for the Plugwise Select integration."""
|
||||||
|
|
||||||
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
from homeassistant.components.select import (
|
||||||
|
ATTR_OPTION,
|
||||||
|
DOMAIN as SELECT_DOMAIN,
|
||||||
|
SERVICE_SELECT_OPTION,
|
||||||
|
)
|
||||||
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
|
async def test_adam_select_entities(
|
||||||
|
hass: HomeAssistant, mock_smile_adam: MagicMock, init_integration: MockConfigEntry
|
||||||
|
) -> None:
|
||||||
|
"""Test a select."""
|
||||||
|
|
||||||
|
state = hass.states.get("select.zone_lisa_wk_thermostat_schedule")
|
||||||
|
assert state
|
||||||
|
assert state.state == "GF7 Woonkamer"
|
||||||
|
|
||||||
|
|
||||||
|
async def test_adam_change_select_entity(
|
||||||
|
hass: HomeAssistant, mock_smile_adam: MagicMock, init_integration: MockConfigEntry
|
||||||
|
) -> None:
|
||||||
|
"""Test changing of select entities."""
|
||||||
|
|
||||||
|
await hass.services.async_call(
|
||||||
|
SELECT_DOMAIN,
|
||||||
|
SERVICE_SELECT_OPTION,
|
||||||
|
{
|
||||||
|
ATTR_ENTITY_ID: "select.zone_lisa_wk_thermostat_schedule",
|
||||||
|
ATTR_OPTION: "Badkamer Schema",
|
||||||
|
},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert mock_smile_adam.set_schedule_state.call_count == 1
|
||||||
|
mock_smile_adam.set_schedule_state.assert_called_with(
|
||||||
|
"c50f167537524366a5af7aa3942feb1e", "Badkamer Schema", "on"
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user