mirror of
https://github.com/fmtr/haco.git
synced 2026-12-01 12:26:31 -05:00
34 lines
678 B
Python
34 lines
678 B
Python
from typing import ClassVar
|
|
|
|
from haco.control import Control
|
|
from haco.utils import ConvertersString
|
|
|
|
|
|
class Select(Control):
|
|
"""
|
|
|
|
A select control (dropdown) for choosing from a list of options in Home Assistant.
|
|
|
|
"""
|
|
DATA: ClassVar[dict] = dict(
|
|
platform='select'
|
|
)
|
|
converters = ConvertersString
|
|
|
|
options: list[str]
|
|
|
|
def command(self, value: str) -> str:
|
|
"""
|
|
|
|
Handle option selection commands from Home Assistant.
|
|
|
|
"""
|
|
raise NotImplementedError()
|
|
|
|
def state(self, value: str | None) -> str:
|
|
"""
|
|
|
|
Return the currently selected option.
|
|
|
|
"""
|
|
raise NotImplementedError()
|