mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Remove entity description mixin in Launch Library (#112902)
This commit is contained in:
parent
d95f30611e
commit
d9996d3add
@ -32,21 +32,14 @@ from .const import DOMAIN
|
|||||||
DEFAULT_NEXT_LAUNCH_NAME = "Next launch"
|
DEFAULT_NEXT_LAUNCH_NAME = "Next launch"
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class LaunchLibrarySensorEntityDescriptionMixin:
|
class LaunchLibrarySensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes a Next Launch sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[Launch | Event], datetime | int | str | None]
|
value_fn: Callable[[Launch | Event], datetime | int | str | None]
|
||||||
attributes_fn: Callable[[Launch | Event], dict[str, Any] | None]
|
attributes_fn: Callable[[Launch | Event], dict[str, Any] | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class LaunchLibrarySensorEntityDescription(
|
|
||||||
SensorEntityDescription, LaunchLibrarySensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes a Next Launch sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_DESCRIPTIONS: tuple[LaunchLibrarySensorEntityDescription, ...] = (
|
SENSOR_DESCRIPTIONS: tuple[LaunchLibrarySensorEntityDescription, ...] = (
|
||||||
LaunchLibrarySensorEntityDescription(
|
LaunchLibrarySensorEntityDescription(
|
||||||
key="next_launch",
|
key="next_launch",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user