Remove entity description mixin in V2C (#112960)
This commit is contained in:
parent
b914ac3185
commit
4b84954d17
4 changed files with 12 additions and 36 deletions
|
@ -28,20 +28,15 @@ from .entity import V2CBaseEntity
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class V2CRequiredKeysMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class V2CSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Describes a V2C EVSE switch entity."""
|
||||
|
||||
value_fn: Callable[[TrydanData], bool]
|
||||
turn_on_fn: Callable[[Trydan], Coroutine[Any, Any, Any]]
|
||||
turn_off_fn: Callable[[Trydan], Coroutine[Any, Any, Any]]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class V2CSwitchEntityDescription(SwitchEntityDescription, V2CRequiredKeysMixin):
|
||||
"""Describes a V2C EVSE switch entity."""
|
||||
|
||||
|
||||
TRYDAN_SWITCHES = (
|
||||
V2CSwitchEntityDescription(
|
||||
key="paused",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue