mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Remove WLED entity descriptions required fields mixins (#103996)
This commit is contained in:
parent
aecfa67265
commit
e9c6da9803
@ -39,18 +39,13 @@ async def async_setup_entry(
|
||||
update_segments()
|
||||
|
||||
|
||||
@dataclass
|
||||
class WLEDNumberDescriptionMixin:
|
||||
"""Mixin for WLED number."""
|
||||
@dataclass(kw_only=True)
|
||||
class WLEDNumberEntityDescription(NumberEntityDescription):
|
||||
"""Class describing WLED number entities."""
|
||||
|
||||
value_fn: Callable[[Segment], float | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WLEDNumberEntityDescription(NumberEntityDescription, WLEDNumberDescriptionMixin):
|
||||
"""Class describing WLED number entities."""
|
||||
|
||||
|
||||
NUMBERS = [
|
||||
WLEDNumberEntityDescription(
|
||||
key=ATTR_SPEED,
|
||||
|
@ -31,20 +31,12 @@ from .coordinator import WLEDDataUpdateCoordinator
|
||||
from .models import WLEDEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class WLEDSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
|
||||
value_fn: Callable[[WLEDDevice], datetime | StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WLEDSensorEntityDescription(
|
||||
SensorEntityDescription, WLEDSensorEntityDescriptionMixin
|
||||
):
|
||||
@dataclass(kw_only=True)
|
||||
class WLEDSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes WLED sensor entity."""
|
||||
|
||||
exists_fn: Callable[[WLEDDevice], bool] = lambda _: True
|
||||
value_fn: Callable[[WLEDDevice], datetime | StateType]
|
||||
|
||||
|
||||
SENSORS: tuple[WLEDSensorEntityDescription, ...] = (
|
||||
|
Loading…
x
Reference in New Issue
Block a user