mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Remove entity description mixin in Tractive (#112952)
Remove entity description mixin in Tractive
This commit is contained in:
parent
c8c00a86a6
commit
a7f71eaa35
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user