Skip to content

Commit

Permalink
Remove entity description mixin in Trafikverket Camera (home-assistan…
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Mar 10, 2024
1 parent a64f043 commit 5f4881c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
13 changes: 3 additions & 10 deletions homeassistant/components/trafikverket_camera/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,13 @@
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",
Expand Down
13 changes: 3 additions & 10 deletions homeassistant/components/trafikverket_camera/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,13 @@
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",
Expand Down

0 comments on commit 5f4881c

Please sign in to comment.