mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
24 lines
687 B
Python
24 lines
687 B
Python
"""Common helpers for select entity component tests."""
|
|
|
|
from pytest_homeassistant.common import MockEntity
|
|
|
|
from homeassistant.components.select import SelectEntity
|
|
|
|
|
|
class MockSelectEntity(MockEntity, SelectEntity):
|
|
"""Mock Select class."""
|
|
|
|
@property
|
|
def current_option(self):
|
|
"""Return the current option of this select."""
|
|
return self._handle("current_option")
|
|
|
|
@property
|
|
def options(self) -> list:
|
|
"""Return the list of available options of this select."""
|
|
return self._handle("options")
|
|
|
|
def select_option(self, option: str) -> None:
|
|
"""Change the selected option."""
|
|
self._values["current_option"] = option
|