mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 05:47:10 +00:00
Remove entity description mixin in SleepIQ (#112940)
This commit is contained in:
parent
fb23d5e6fb
commit
37e0a9d9c7
@ -18,20 +18,13 @@ from .coordinator import SleepIQData
|
||||
from .entity import SleepIQEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SleepIQButtonEntityDescriptionMixin:
|
||||
"""Describes a SleepIQ Button entity."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SleepIQButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Class to describe a Button entity."""
|
||||
|
||||
press_action: Callable[[SleepIQBed], Any]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SleepIQButtonEntityDescription(
|
||||
ButtonEntityDescription, SleepIQButtonEntityDescriptionMixin
|
||||
):
|
||||
"""Class to describe a Button entity."""
|
||||
|
||||
|
||||
ENTITY_DESCRIPTIONS = [
|
||||
SleepIQButtonEntityDescription(
|
||||
key="calibrate",
|
||||
|
@ -31,9 +31,9 @@ from .coordinator import SleepIQData, SleepIQDataUpdateCoordinator
|
||||
from .entity import SleepIQBedEntity, sleeper_for_side
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SleepIQNumberEntityDescriptionMixin:
|
||||
"""Mixin to describe a SleepIQ number entity."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SleepIQNumberEntityDescription(NumberEntityDescription):
|
||||
"""Class to describe a SleepIQ number entity."""
|
||||
|
||||
value_fn: Callable[[Any], float]
|
||||
set_value_fn: Callable[[Any, int], Coroutine[None, None, None]]
|
||||
@ -41,13 +41,6 @@ class SleepIQNumberEntityDescriptionMixin:
|
||||
get_unique_id_fn: Callable[[SleepIQBed, Any], str]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SleepIQNumberEntityDescription(
|
||||
NumberEntityDescription, SleepIQNumberEntityDescriptionMixin
|
||||
):
|
||||
"""Class to describe a SleepIQ number entity."""
|
||||
|
||||
|
||||
async def _async_set_firmness(sleeper: SleepIQSleeper, firmness: int) -> None:
|
||||
await sleeper.set_sleepnumber(firmness)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user