Remove entity description mixin in EZVIZ (#112764)
This commit is contained in:
parent
bfd7582825
commit
06637c0960
5 changed files with 15 additions and 50 deletions
|
@ -34,20 +34,13 @@ SCAN_INTERVAL = timedelta(seconds=60)
|
|||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizAlarmControlPanelEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Alarm control panel entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class EzvizAlarmControlPanelEntityDescription(AlarmControlPanelEntityDescription):
|
||||
"""Describe an EZVIZ Alarm control panel entity."""
|
||||
|
||||
ezviz_alarm_states: list
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizAlarmControlPanelEntityDescription(
|
||||
AlarmControlPanelEntityDescription, EzvizAlarmControlPanelEntityDescriptionMixin
|
||||
):
|
||||
"""Describe an EZVIZ Alarm control panel entity."""
|
||||
|
||||
|
||||
ALARM_TYPE = EzvizAlarmControlPanelEntityDescription(
|
||||
key="ezviz_alarm",
|
||||
ezviz_alarm_states=[
|
||||
|
|
|
@ -23,21 +23,14 @@ from .entity import EzvizEntity
|
|||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizButtonEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ button entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class EzvizButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Describe a EZVIZ Button."""
|
||||
|
||||
method: Callable[[EzvizClient, str, str], Any]
|
||||
supported_ext: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizButtonEntityDescription(
|
||||
ButtonEntityDescription, EzvizButtonEntityDescriptionMixin
|
||||
):
|
||||
"""Describe a EZVIZ Button."""
|
||||
|
||||
|
||||
BUTTON_ENTITIES = (
|
||||
EzvizButtonEntityDescription(
|
||||
key="ptz_up",
|
||||
|
|
|
@ -31,21 +31,14 @@ PARALLEL_UPDATES = 0
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizNumberEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Number entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class EzvizNumberEntityDescription(NumberEntityDescription):
|
||||
"""Describe a EZVIZ Number."""
|
||||
|
||||
supported_ext: str
|
||||
supported_ext_value: list
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizNumberEntityDescription(
|
||||
NumberEntityDescription, EzvizNumberEntityDescriptionMixin
|
||||
):
|
||||
"""Describe a EZVIZ Number."""
|
||||
|
||||
|
||||
NUMBER_TYPE = EzvizNumberEntityDescription(
|
||||
key="detection_sensibility",
|
||||
translation_key="detection_sensibility",
|
||||
|
|
|
@ -21,20 +21,13 @@ from .entity import EzvizEntity
|
|||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSelectEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Select entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class EzvizSelectEntityDescription(SelectEntityDescription):
|
||||
"""Describe a EZVIZ Select entity."""
|
||||
|
||||
supported_switch: int
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSelectEntityDescription(
|
||||
SelectEntityDescription, EzvizSelectEntityDescriptionMixin
|
||||
):
|
||||
"""Describe a EZVIZ Select entity."""
|
||||
|
||||
|
||||
SELECT_TYPE = EzvizSelectEntityDescription(
|
||||
key="alarm_sound_mod",
|
||||
translation_key="alarm_sound_mode",
|
||||
|
|
|
@ -23,20 +23,13 @@ from .coordinator import EzvizDataUpdateCoordinator
|
|||
from .entity import EzvizEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSwitchEntityDescriptionMixin:
|
||||
"""Mixin values for EZVIZ Switch entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class EzvizSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Describe a EZVIZ switch."""
|
||||
|
||||
supported_ext: str | None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EzvizSwitchEntityDescription(
|
||||
SwitchEntityDescription, EzvizSwitchEntityDescriptionMixin
|
||||
):
|
||||
"""Describe a EZVIZ switch."""
|
||||
|
||||
|
||||
SWITCH_TYPES: dict[int, EzvizSwitchEntityDescription] = {
|
||||
3: EzvizSwitchEntityDescription(
|
||||
key="3",
|
||||
|
|
Loading…
Add table
Reference in a new issue