Remove Rituals Parfume Genie entity descriptions required fields mixins (#103999)
parent
1a079d7c6f
commit
76ccad40ff
|
@ -21,21 +21,14 @@ from .coordinator import RitualsDataUpdateCoordinator
|
|||
from .entity import DiffuserEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsentityDescriptionMixin:
|
||||
"""Mixin values for Rituals entities."""
|
||||
@dataclass(kw_only=True)
|
||||
class RitualsBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Class describing Rituals binary sensor entities."""
|
||||
|
||||
is_on_fn: Callable[[Diffuser], bool]
|
||||
has_fn: Callable[[Diffuser], bool]
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, RitualsentityDescriptionMixin
|
||||
):
|
||||
"""Class describing Rituals binary sensor entities."""
|
||||
|
||||
|
||||
ENTITY_DESCRIPTIONS = (
|
||||
RitualsBinarySensorEntityDescription(
|
||||
key="charging",
|
||||
|
|
|
@ -17,21 +17,14 @@ from .coordinator import RitualsDataUpdateCoordinator
|
|||
from .entity import DiffuserEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsNumberEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(kw_only=True)
|
||||
class RitualsNumberEntityDescription(NumberEntityDescription):
|
||||
"""Class describing Rituals number entities."""
|
||||
|
||||
value_fn: Callable[[Diffuser], int]
|
||||
set_value_fn: Callable[[Diffuser, int], Awaitable[Any]]
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsNumberEntityDescription(
|
||||
NumberEntityDescription, RitualsNumberEntityDescriptionMixin
|
||||
):
|
||||
"""Class describing Rituals number entities."""
|
||||
|
||||
|
||||
ENTITY_DESCRIPTIONS = (
|
||||
RitualsNumberEntityDescription(
|
||||
key="perfume_amount",
|
||||
|
|
|
@ -17,21 +17,14 @@ from .coordinator import RitualsDataUpdateCoordinator
|
|||
from .entity import DiffuserEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(kw_only=True)
|
||||
class RitualsSelectEntityDescription(SelectEntityDescription):
|
||||
"""Class describing Rituals select entities."""
|
||||
|
||||
current_fn: Callable[[Diffuser], str]
|
||||
select_fn: Callable[[Diffuser, str], Awaitable[None]]
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsSelectEntityDescription(
|
||||
SelectEntityDescription, RitualsEntityDescriptionMixin
|
||||
):
|
||||
"""Class describing Rituals select entities."""
|
||||
|
||||
|
||||
ENTITY_DESCRIPTIONS = (
|
||||
RitualsSelectEntityDescription(
|
||||
key="room_size_square_meter",
|
||||
|
|
|
@ -21,20 +21,12 @@ from .coordinator import RitualsDataUpdateCoordinator
|
|||
from .entity import DiffuserEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsEntityDescriptionMixin:
|
||||
"""Mixin values for Rituals entities."""
|
||||
|
||||
value_fn: Callable[[Diffuser], int | str]
|
||||
|
||||
|
||||
@dataclass
|
||||
class RitualsSensorEntityDescription(
|
||||
SensorEntityDescription, RitualsEntityDescriptionMixin
|
||||
):
|
||||
@dataclass(kw_only=True)
|
||||
class RitualsSensorEntityDescription(SensorEntityDescription):
|
||||
"""Class describing Rituals sensor entities."""
|
||||
|
||||
has_fn: Callable[[Diffuser], bool] = lambda _: True
|
||||
value_fn: Callable[[Diffuser], int | str]
|
||||
|
||||
|
||||
ENTITY_DESCRIPTIONS = (
|
||||
|
|
Loading…
Reference in New Issue