mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Remove entity description mixin in Android IP Webcam (#112380)
This commit is contained in:
parent
d369447961
commit
71be56e1fd
@ -23,19 +23,11 @@ from .coordinator import AndroidIPCamDataUpdateCoordinator
|
||||
from .entity import AndroidIPCamBaseEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[PyDroidIPCam], StateType]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSensorEntityDescription(
|
||||
SensorEntityDescription, AndroidIPWebcamSensorEntityDescriptionMixin
|
||||
):
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class AndroidIPWebcamSensorEntityDescription(SensorEntityDescription):
|
||||
"""Entity description class for Android IP Webcam sensors."""
|
||||
|
||||
value_fn: Callable[[PyDroidIPCam], StateType]
|
||||
unit_fn: Callable[[PyDroidIPCam], str | None] = lambda _: None
|
||||
|
||||
|
||||
|
@ -18,21 +18,14 @@ from .coordinator import AndroidIPCamDataUpdateCoordinator
|
||||
from .entity import AndroidIPCamBaseEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSwitchEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class AndroidIPWebcamSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Entity description class for Android IP Webcam switches."""
|
||||
|
||||
on_func: Callable[[PyDroidIPCam], Coroutine[Any, Any, bool]]
|
||||
off_func: Callable[[PyDroidIPCam], Coroutine[Any, Any, bool]]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AndroidIPWebcamSwitchEntityDescription(
|
||||
SwitchEntityDescription, AndroidIPWebcamSwitchEntityDescriptionMixin
|
||||
):
|
||||
"""Entity description class for Android IP Webcam switches."""
|
||||
|
||||
|
||||
SWITCH_TYPES: tuple[AndroidIPWebcamSwitchEntityDescription, ...] = (
|
||||
AndroidIPWebcamSwitchEntityDescription(
|
||||
key="exposure_lock",
|
||||
|
Loading…
x
Reference in New Issue
Block a user