mirror of
https://github.com/home-assistant/core.git
synced 2026-02-05 23:05:25 +01:00
24 lines
672 B
Python
24 lines
672 B
Python
|
|
"""Common helpers for select entity component tests."""
|
||
|
|
|
||
|
|
from homeassistant.components.select import SelectEntity
|
||
|
|
|
||
|
|
from tests.common import MockEntity
|
||
|
|
|
||
|
|
|
||
|
|
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
|