mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Remove entity description mixin in Trafikverket Camera (#112954)
This commit is contained in:
parent
a64f043a93
commit
5f4881cb28
@ -20,20 +20,13 @@ from .entity import TrafikverketCameraNonCameraEntity
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class DeviceBaseEntityDescriptionMixin:
|
class TVCameraSensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Mixin for required Trafikverket Camera base description keys."""
|
"""Describes Trafikverket Camera binary sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[CameraData], bool | None]
|
value_fn: Callable[[CameraData], bool | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TVCameraSensorEntityDescription(
|
|
||||||
BinarySensorEntityDescription, DeviceBaseEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes Trafikverket Camera binary sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
BINARY_SENSOR_TYPE = TVCameraSensorEntityDescription(
|
BINARY_SENSOR_TYPE = TVCameraSensorEntityDescription(
|
||||||
key="active",
|
key="active",
|
||||||
translation_key="active",
|
translation_key="active",
|
||||||
|
@ -24,20 +24,13 @@ from .entity import TrafikverketCameraNonCameraEntity
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class DeviceBaseEntityDescriptionMixin:
|
class TVCameraSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required Trafikverket Camera base description keys."""
|
"""Describes Trafikverket Camera sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[CameraData], StateType | datetime]
|
value_fn: Callable[[CameraData], StateType | datetime]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TVCameraSensorEntityDescription(
|
|
||||||
SensorEntityDescription, DeviceBaseEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes Trafikverket Camera sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_TYPES: tuple[TVCameraSensorEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[TVCameraSensorEntityDescription, ...] = (
|
||||||
TVCameraSensorEntityDescription(
|
TVCameraSensorEntityDescription(
|
||||||
key="direction",
|
key="direction",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user