Add prototype doc

This commit is contained in:
Edward Brown 2026-04-29 10:47:13 +01:00
parent 8dc96d708d
commit f42becceb0
24 changed files with 657 additions and 51 deletions

View file

@ -5,13 +5,27 @@ from haco.control import Control
@dataclass(kw_only=True)
class Switch(Control):
"""
A switch control that can be toggled on or off.
"""
DATA = dict(
platform='switch'
)
def command(self, value: bool) -> bool:
"""
def command(self, value):
Handle toggle commands from Home Assistant.
"""
raise NotImplementedError()
def state(self, value):
def state(self, value: bool | None) -> bool:
"""
Return the current state of the switch.
"""
raise NotImplementedError()