haco/haco/text.py
Edward Brown 911b75a295
Some checks failed
Version and Deploy / build (push) Has been cancelled
Implement Text and Sensor controls
2025-12-02 09:15:27 +00:00

29 lines
574 B
Python

from dataclasses import dataclass
from enum import StrEnum
from haco.control import Control
from haco.utils import ConvertersString
class Mode(StrEnum):
TEXT = "text"
PASSWORD = "password"
@dataclass(kw_only=True)
class Text(Control):
DATA = dict(
platform='text'
)
converters = ConvertersString
pattern: str | None = None
min: int | None = None
max: int | None = None
mode: Mode = Mode.TEXT
def command(self, value):
raise NotImplementedError()
def state(self, value):
raise NotImplementedError()