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
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DeviceBaseEntityDescriptionMixin:
|
||||
"""Mixin for required Trafikverket Camera base description keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class TVCameraSensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Describes Trafikverket Camera binary sensor entity."""
|
||||
|
||||
value_fn: Callable[[CameraData], bool | None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TVCameraSensorEntityDescription(
|
||||
BinarySensorEntityDescription, DeviceBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Describes Trafikverket Camera binary sensor entity."""
|
||||
|
||||
|
||||
BINARY_SENSOR_TYPE = TVCameraSensorEntityDescription(
|
||||
key="active",
|
||||
translation_key="active",
|
||||
|
@ -24,20 +24,13 @@ from .entity import TrafikverketCameraNonCameraEntity
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DeviceBaseEntityDescriptionMixin:
|
||||
"""Mixin for required Trafikverket Camera base description keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class TVCameraSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes Trafikverket Camera sensor entity."""
|
||||
|
||||
value_fn: Callable[[CameraData], StateType | datetime]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TVCameraSensorEntityDescription(
|
||||
SensorEntityDescription, DeviceBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Describes Trafikverket Camera sensor entity."""
|
||||
|
||||
|
||||
SENSOR_TYPES: tuple[TVCameraSensorEntityDescription, ...] = (
|
||||
TVCameraSensorEntityDescription(
|
||||
key="direction",
|
||||
|
Loading…
x
Reference in New Issue
Block a user