Remove entity description mixin in Overkiz (#112914)

pull/112989/head
Joost Lekkerkerker 2024-03-10 18:06:17 +01:00 committed by GitHub
parent 113df1ab62
commit dec98d424f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 45 deletions

View File

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

View File

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

View File

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

View File

@ -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]:

View File

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