Skip to content

Commit

Permalink
Remove entity description mixin in Trafikverket Ferry (home-assistant…
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Mar 10, 2024
1 parent 39c617e commit a64f043
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions homeassistant/components/trafikverket_ferry/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,14 @@
SCAN_INTERVAL = timedelta(minutes=5)


@dataclass(frozen=True)
class TrafikverketRequiredKeysMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class TrafikverketSensorEntityDescription(SensorEntityDescription):
"""Describes Trafikverket sensor entity."""

value_fn: Callable[[dict[str, Any]], StateType | datetime]
info_fn: Callable[[dict[str, Any]], StateType | list] | None


@dataclass(frozen=True)
class TrafikverketSensorEntityDescription(
SensorEntityDescription, TrafikverketRequiredKeysMixin
):
"""Describes Trafikverket sensor entity."""


SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
TrafikverketSensorEntityDescription(
key="departure_time",
Expand Down

0 comments on commit a64f043

Please sign in to comment.