Remove entity description mixin in Ecoforest (#112409)
This commit is contained in:
parent
362a10e82e
commit
dd3c11f179
3 changed files with 9 additions and 30 deletions
|
@ -17,21 +17,14 @@ from .coordinator import EcoforestCoordinator
|
|||
from .entity import EcoforestEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestSwitchRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class EcoforestSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Describes an Ecoforest switch entity."""
|
||||
|
||||
value_fn: Callable[[Device], bool]
|
||||
switch_fn: Callable[[EcoforestApi, bool], Awaitable[Device]]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class EcoforestSwitchEntityDescription(
|
||||
SwitchEntityDescription, EcoforestSwitchRequiredKeysMixin
|
||||
):
|
||||
"""Describes an Ecoforest switch entity."""
|
||||
|
||||
|
||||
SWITCH_TYPES: tuple[EcoforestSwitchEntityDescription, ...] = (
|
||||
EcoforestSwitchEntityDescription(
|
||||
key="status",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue