mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +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
|
from .entity import TractiveEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class TractiveRequiredKeysMixin:
|
class TractiveSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Class describing Tractive sensor entities."""
|
||||||
|
|
||||||
signal_prefix: str
|
signal_prefix: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TractiveSensorEntityDescription(
|
|
||||||
SensorEntityDescription, TractiveRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""Class describing Tractive sensor entities."""
|
|
||||||
|
|
||||||
hardware_sensor: bool = False
|
hardware_sensor: bool = False
|
||||||
value_fn: Callable[[StateType], StateType] = lambda state: state
|
value_fn: Callable[[StateType], StateType] = lambda state: state
|
||||||
|
|
||||||
|
@ -29,20 +29,13 @@ from .entity import TractiveEntity
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class TractiveRequiredKeysMixin:
|
class TractiveSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Class describing Tractive switch entities."""
|
||||||
|
|
||||||
method: Literal["async_set_buzzer", "async_set_led", "async_set_live_tracking"]
|
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, ...] = (
|
SWITCH_TYPES: tuple[TractiveSwitchEntityDescription, ...] = (
|
||||||
TractiveSwitchEntityDescription(
|
TractiveSwitchEntityDescription(
|
||||||
key=ATTR_BUZZER,
|
key=ATTR_BUZZER,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user