mirror of
https://github.com/fmtr/haco.git
synced 2026-12-02 04:46:39 -05:00
Add prototype doc
This commit is contained in:
parent
8dc96d708d
commit
f42becceb0
24 changed files with 657 additions and 51 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue