Implement switch

This commit is contained in:
Edward Brown 2025-11-23 11:34:49 +00:00
parent 97267b8e29
commit ea8650f232
2 changed files with 13 additions and 9 deletions

View file

@ -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()