mirror of
https://github.com/fmtr/haco.git
synced 2026-12-04 05:40:10 -05:00
Implement switch
This commit is contained in:
parent
97267b8e29
commit
ea8650f232
2 changed files with 13 additions and 9 deletions
|
|
@ -1,14 +1,15 @@
|
|||
from haco.tools import invert_bool
|
||||
from dataclasses import dataclass
|
||||
from typing import Literal
|
||||
|
||||
from haco.control import Control
|
||||
from control import Control
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
class Switch(Control):
|
||||
NAME = 'switch'
|
||||
platform: Literal["climate"] = "switch"
|
||||
|
||||
def __init__(self, name, icon=None):
|
||||
super().__init__(name, icon=icon)
|
||||
def command(self, value):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def control_type(self):
|
||||
return invert_bool
|
||||
def state(self, value):
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue