mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove sun entity description required fields mixin (#105848)
This commit is contained in:
parent
ef59394ef4
commit
bb6f78dcc4
@ -26,19 +26,14 @@ from .const import DOMAIN, SIGNAL_EVENTS_CHANGED, SIGNAL_POSITION_CHANGED
|
|||||||
ENTITY_ID_SENSOR_FORMAT = SENSOR_DOMAIN + ".sun_{}"
|
ENTITY_ID_SENSOR_FORMAT = SENSOR_DOMAIN + ".sun_{}"
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(kw_only=True, frozen=True)
|
||||||
class SunEntityDescriptionMixin:
|
class SunSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required Sun base description keys."""
|
"""Describes a Sun sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[Sun], StateType | datetime]
|
value_fn: Callable[[Sun], StateType | datetime]
|
||||||
signal: str
|
signal: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SunSensorEntityDescription(SensorEntityDescription, SunEntityDescriptionMixin):
|
|
||||||
"""Describes Sun sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_TYPES: tuple[SunSensorEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[SunSensorEntityDescription, ...] = (
|
||||||
SunSensorEntityDescription(
|
SunSensorEntityDescription(
|
||||||
key="next_dawn",
|
key="next_dawn",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user