Remove entity description mixin in Trafikverket Weatherstation (#112957)
This commit is contained in:
parent
dec98d424f
commit
13b8fd4149
1 changed files with 3 additions and 10 deletions
|
@ -43,20 +43,13 @@ PRECIPITATION_TYPE = [
|
|||
]
|
||||
|
||||
|
||||
@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[[WeatherStationInfo], StateType | datetime]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TrafikverketSensorEntityDescription(
|
||||
SensorEntityDescription, TrafikverketRequiredKeysMixin
|
||||
):
|
||||
"""Describes Trafikverket sensor entity."""
|
||||
|
||||
|
||||
def add_utc_timezone(date_time: datetime | None) -> datetime | None:
|
||||
"""Add UTC timezone if datetime."""
|
||||
if date_time:
|
||||
|
|
Loading…
Add table
Reference in a new issue