Remove entity description mixin in Overkiz (#112914)
parent
113df1ab62
commit
dec98d424f
|
@ -36,20 +36,13 @@ from .coordinator import OverkizDataUpdateCoordinator
|
|||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizAlarmDescriptionMixin:
|
||||
"""Define an entity description mixin for switch entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class OverkizAlarmDescription(AlarmControlPanelEntityDescription):
|
||||
"""Class to describe an Overkiz alarm control panel."""
|
||||
|
||||
supported_features: AlarmControlPanelEntityFeature
|
||||
fn_state: Callable[[Callable[[str], OverkizStateType]], str]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizAlarmDescription(
|
||||
AlarmControlPanelEntityDescription, OverkizAlarmDescriptionMixin
|
||||
):
|
||||
"""Class to describe an Overkiz alarm control panel."""
|
||||
|
||||
alarm_disarm: str | None = None
|
||||
alarm_disarm_args: OverkizStateType | list[OverkizStateType] = None
|
||||
alarm_arm_home: str | None = None
|
||||
|
|
|
@ -23,20 +23,13 @@ from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
|||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizBinarySensorDescriptionMixin:
|
||||
"""Define an entity description mixin for binary sensor entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class OverkizBinarySensorDescription(BinarySensorEntityDescription):
|
||||
"""Class to describe an Overkiz binary sensor."""
|
||||
|
||||
value_fn: Callable[[OverkizStateType], bool]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizBinarySensorDescription(
|
||||
BinarySensorEntityDescription, OverkizBinarySensorDescriptionMixin
|
||||
):
|
||||
"""Class to describe an Overkiz binary sensor."""
|
||||
|
||||
|
||||
BINARY_SENSOR_DESCRIPTIONS: list[OverkizBinarySensorDescription] = [
|
||||
# RainSensor/RainSensor
|
||||
OverkizBinarySensorDescription(
|
||||
|
|
|
@ -28,17 +28,12 @@ BOOST_MODE_DURATION_DELAY = 1
|
|||
OPERATING_MODE_DELAY = 3
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizNumberDescriptionMixin:
|
||||
"""Define an entity description mixin for number entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class OverkizNumberDescription(NumberEntityDescription):
|
||||
"""Class to describe an Overkiz number."""
|
||||
|
||||
command: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizNumberDescription(NumberEntityDescription, OverkizNumberDescriptionMixin):
|
||||
"""Class to describe an Overkiz number."""
|
||||
|
||||
min_value_state_name: str | None = None
|
||||
max_value_state_name: str | None = None
|
||||
inverted: bool = False
|
||||
|
|
|
@ -18,18 +18,13 @@ from .const import DOMAIN, IGNORED_OVERKIZ_DEVICES
|
|||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizSelectDescriptionMixin:
|
||||
"""Define an entity description mixin for select entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class OverkizSelectDescription(SelectEntityDescription):
|
||||
"""Class to describe an Overkiz select entity."""
|
||||
|
||||
select_option: Callable[[str, Callable[..., Awaitable[None]]], Awaitable[None]]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizSelectDescription(SelectEntityDescription, OverkizSelectDescriptionMixin):
|
||||
"""Class to describe an Overkiz select entity."""
|
||||
|
||||
|
||||
def _select_option_open_closed_pedestrian(
|
||||
option: str, execute_command: Callable[..., Awaitable[None]]
|
||||
) -> Awaitable[None]:
|
||||
|
|
|
@ -25,18 +25,12 @@ from .const import DOMAIN
|
|||
from .entity import OverkizDescriptiveEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizSwitchDescriptionMixin:
|
||||
"""Define an entity description mixin for switch entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class OverkizSwitchDescription(SwitchEntityDescription):
|
||||
"""Class to describe an Overkiz switch."""
|
||||
|
||||
turn_on: str
|
||||
turn_off: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OverkizSwitchDescription(SwitchEntityDescription, OverkizSwitchDescriptionMixin):
|
||||
"""Class to describe an Overkiz switch."""
|
||||
|
||||
is_on: Callable[[Callable[[str], OverkizStateType]], bool] | None = None
|
||||
turn_on_args: OverkizStateType | list[OverkizStateType] | None = None
|
||||
turn_off_args: OverkizStateType | list[OverkizStateType] | None = None
|
||||
|
|
Loading…
Reference in New Issue