Remove entity description mixin in Tractive (#112952)

Remove entity description mixin in
Tractive
This commit is contained in:
Joost Lekkerkerker 2024-03-10 21:45:06 +01:00 committed by GitHub
parent c8c00a86a6
commit a7f71eaa35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 20 deletions

View File

@ -44,19 +44,12 @@ from .const import (
from .entity import TractiveEntity
@dataclass(frozen=True)
class TractiveRequiredKeysMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class TractiveSensorEntityDescription(SensorEntityDescription):
"""Class describing Tractive sensor entities."""
signal_prefix: str
@dataclass(frozen=True)
class TractiveSensorEntityDescription(
SensorEntityDescription, TractiveRequiredKeysMixin
):
"""Class describing Tractive sensor entities."""
hardware_sensor: bool = False
value_fn: Callable[[StateType], StateType] = lambda state: state

View File

@ -29,20 +29,13 @@ from .entity import TractiveEntity
_LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True)
class TractiveRequiredKeysMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class TractiveSwitchEntityDescription(SwitchEntityDescription):
"""Class describing Tractive switch entities."""
method: Literal["async_set_buzzer", "async_set_led", "async_set_live_tracking"]
@dataclass(frozen=True)
class TractiveSwitchEntityDescription(
SwitchEntityDescription, TractiveRequiredKeysMixin
):
"""Class describing Tractive switch entities."""
SWITCH_TYPES: tuple[TractiveSwitchEntityDescription, ...] = (
TractiveSwitchEntityDescription(
key=ATTR_BUZZER,