Remove entity description mixin in Onvif (#112912)
parent
b48032e37e
commit
f86119aec7
|
@ -17,9 +17,9 @@ from .device import ONVIFDevice
|
||||||
from .models import Profile
|
from .models import Profile
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class ONVIFSwitchEntityDescriptionMixin:
|
class ONVIFSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes ONVIF switch entity."""
|
||||||
|
|
||||||
turn_on_fn: Callable[
|
turn_on_fn: Callable[
|
||||||
[ONVIFDevice], Callable[[Profile, Any], Coroutine[Any, Any, None]]
|
[ONVIFDevice], Callable[[Profile, Any], Coroutine[Any, Any, None]]
|
||||||
|
@ -32,13 +32,6 @@ class ONVIFSwitchEntityDescriptionMixin:
|
||||||
supported_fn: Callable[[ONVIFDevice], bool]
|
supported_fn: Callable[[ONVIFDevice], bool]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class ONVIFSwitchEntityDescription(
|
|
||||||
SwitchEntityDescription, ONVIFSwitchEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes ONVIF switch entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SWITCHES: tuple[ONVIFSwitchEntityDescription, ...] = (
|
SWITCHES: tuple[ONVIFSwitchEntityDescription, ...] = (
|
||||||
ONVIFSwitchEntityDescription(
|
ONVIFSwitchEntityDescription(
|
||||||
key="autofocus",
|
key="autofocus",
|
||||||
|
|
Loading…
Reference in New Issue