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