mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +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
|
from .entity import AndroidIPCamBaseEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class AndroidIPWebcamSensorEntityDescriptionMixin:
|
class AndroidIPWebcamSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
|
||||||
|
|
||||||
value_fn: Callable[[PyDroidIPCam], StateType]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class AndroidIPWebcamSensorEntityDescription(
|
|
||||||
SensorEntityDescription, AndroidIPWebcamSensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Entity description class for Android IP Webcam sensors."""
|
"""Entity description class for Android IP Webcam sensors."""
|
||||||
|
|
||||||
|
value_fn: Callable[[PyDroidIPCam], StateType]
|
||||||
unit_fn: Callable[[PyDroidIPCam], str | None] = lambda _: None
|
unit_fn: Callable[[PyDroidIPCam], str | None] = lambda _: None
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,21 +18,14 @@ from .coordinator import AndroidIPCamDataUpdateCoordinator
|
|||||||
from .entity import AndroidIPCamBaseEntity
|
from .entity import AndroidIPCamBaseEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class AndroidIPWebcamSwitchEntityDescriptionMixin:
|
class AndroidIPWebcamSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Entity description class for Android IP Webcam switches."""
|
||||||
|
|
||||||
on_func: Callable[[PyDroidIPCam], Coroutine[Any, Any, bool]]
|
on_func: Callable[[PyDroidIPCam], Coroutine[Any, Any, bool]]
|
||||||
off_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, ...] = (
|
SWITCH_TYPES: tuple[AndroidIPWebcamSwitchEntityDescription, ...] = (
|
||||||
AndroidIPWebcamSwitchEntityDescription(
|
AndroidIPWebcamSwitchEntityDescription(
|
||||||
key="exposure_lock",
|
key="exposure_lock",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user