mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Remove entity description mixin in Trafikverket Ferry (#112955)
This commit is contained in:
parent
39c617eee6
commit
a64f043a93
@ -32,21 +32,14 @@ ATTR_OTHER_INFO = "other_info"
|
|||||||
SCAN_INTERVAL = timedelta(minutes=5)
|
SCAN_INTERVAL = timedelta(minutes=5)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class TrafikverketRequiredKeysMixin:
|
class TrafikverketSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes Trafikverket sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[dict[str, Any]], StateType | datetime]
|
value_fn: Callable[[dict[str, Any]], StateType | datetime]
|
||||||
info_fn: Callable[[dict[str, Any]], StateType | list] | None
|
info_fn: Callable[[dict[str, Any]], StateType | list] | None
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TrafikverketSensorEntityDescription(
|
|
||||||
SensorEntityDescription, TrafikverketRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""Describes Trafikverket sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="departure_time",
|
key="departure_time",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user