Remove entity description mixin in Trafikverket Ferry (#112955)
This commit is contained in:
parent
39c617eee6
commit
a64f043a93
1 changed files with 3 additions and 10 deletions
|
@ -32,21 +32,14 @@ ATTR_OTHER_INFO = "other_info"
|
|||
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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue