mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Remove entity description mixin in EZVIZ (#112764)
This commit is contained in:
parent
bfd7582825
commit
06637c0960
@ -34,20 +34,13 @@ SCAN_INTERVAL = timedelta(seconds=60)
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EzvizAlarmControlPanelEntityDescriptionMixin:
|
class EzvizAlarmControlPanelEntityDescription(AlarmControlPanelEntityDescription):
|
||||||
"""Mixin values for EZVIZ Alarm control panel entities."""
|
"""Describe an EZVIZ Alarm control panel entity."""
|
||||||
|
|
||||||
ezviz_alarm_states: list
|
ezviz_alarm_states: list
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EzvizAlarmControlPanelEntityDescription(
|
|
||||||
AlarmControlPanelEntityDescription, EzvizAlarmControlPanelEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describe an EZVIZ Alarm control panel entity."""
|
|
||||||
|
|
||||||
|
|
||||||
ALARM_TYPE = EzvizAlarmControlPanelEntityDescription(
|
ALARM_TYPE = EzvizAlarmControlPanelEntityDescription(
|
||||||
key="ezviz_alarm",
|
key="ezviz_alarm",
|
||||||
ezviz_alarm_states=[
|
ezviz_alarm_states=[
|
||||||
|
@ -23,21 +23,14 @@ from .entity import EzvizEntity
|
|||||||
PARALLEL_UPDATES = 1
|
PARALLEL_UPDATES = 1
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EzvizButtonEntityDescriptionMixin:
|
class EzvizButtonEntityDescription(ButtonEntityDescription):
|
||||||
"""Mixin values for EZVIZ button entities."""
|
"""Describe a EZVIZ Button."""
|
||||||
|
|
||||||
method: Callable[[EzvizClient, str, str], Any]
|
method: Callable[[EzvizClient, str, str], Any]
|
||||||
supported_ext: str
|
supported_ext: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EzvizButtonEntityDescription(
|
|
||||||
ButtonEntityDescription, EzvizButtonEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describe a EZVIZ Button."""
|
|
||||||
|
|
||||||
|
|
||||||
BUTTON_ENTITIES = (
|
BUTTON_ENTITIES = (
|
||||||
EzvizButtonEntityDescription(
|
EzvizButtonEntityDescription(
|
||||||
key="ptz_up",
|
key="ptz_up",
|
||||||
|
@ -31,21 +31,14 @@ PARALLEL_UPDATES = 0
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EzvizNumberEntityDescriptionMixin:
|
class EzvizNumberEntityDescription(NumberEntityDescription):
|
||||||
"""Mixin values for EZVIZ Number entities."""
|
"""Describe a EZVIZ Number."""
|
||||||
|
|
||||||
supported_ext: str
|
supported_ext: str
|
||||||
supported_ext_value: list
|
supported_ext_value: list
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EzvizNumberEntityDescription(
|
|
||||||
NumberEntityDescription, EzvizNumberEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describe a EZVIZ Number."""
|
|
||||||
|
|
||||||
|
|
||||||
NUMBER_TYPE = EzvizNumberEntityDescription(
|
NUMBER_TYPE = EzvizNumberEntityDescription(
|
||||||
key="detection_sensibility",
|
key="detection_sensibility",
|
||||||
translation_key="detection_sensibility",
|
translation_key="detection_sensibility",
|
||||||
|
@ -21,20 +21,13 @@ from .entity import EzvizEntity
|
|||||||
PARALLEL_UPDATES = 1
|
PARALLEL_UPDATES = 1
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EzvizSelectEntityDescriptionMixin:
|
class EzvizSelectEntityDescription(SelectEntityDescription):
|
||||||
"""Mixin values for EZVIZ Select entities."""
|
"""Describe a EZVIZ Select entity."""
|
||||||
|
|
||||||
supported_switch: int
|
supported_switch: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EzvizSelectEntityDescription(
|
|
||||||
SelectEntityDescription, EzvizSelectEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describe a EZVIZ Select entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SELECT_TYPE = EzvizSelectEntityDescription(
|
SELECT_TYPE = EzvizSelectEntityDescription(
|
||||||
key="alarm_sound_mod",
|
key="alarm_sound_mod",
|
||||||
translation_key="alarm_sound_mode",
|
translation_key="alarm_sound_mode",
|
||||||
|
@ -23,20 +23,13 @@ from .coordinator import EzvizDataUpdateCoordinator
|
|||||||
from .entity import EzvizEntity
|
from .entity import EzvizEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EzvizSwitchEntityDescriptionMixin:
|
class EzvizSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin values for EZVIZ Switch entities."""
|
"""Describe a EZVIZ switch."""
|
||||||
|
|
||||||
supported_ext: str | None
|
supported_ext: str | None
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EzvizSwitchEntityDescription(
|
|
||||||
SwitchEntityDescription, EzvizSwitchEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describe a EZVIZ switch."""
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_TYPES: dict[int, EzvizSwitchEntityDescription] = {
|
SWITCH_TYPES: dict[int, EzvizSwitchEntityDescription] = {
|
||||||
3: EzvizSwitchEntityDescription(
|
3: EzvizSwitchEntityDescription(
|
||||||
key="3",
|
key="3",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user