mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove entity description mixin in Tautulli (#112949)
This commit is contained in:
parent
276b8147d3
commit
1bc6277c47
@ -44,20 +44,13 @@ def get_top_stats(
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class TautulliSensorEntityMixin:
|
class TautulliSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for Tautulli sensor."""
|
"""Describes a Tautulli sensor."""
|
||||||
|
|
||||||
value_fn: Callable[[PyTautulliApiHomeStats, PyTautulliApiActivity, str], StateType]
|
value_fn: Callable[[PyTautulliApiHomeStats, PyTautulliApiActivity, str], StateType]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TautulliSensorEntityDescription(
|
|
||||||
SensorEntityDescription, TautulliSensorEntityMixin
|
|
||||||
):
|
|
||||||
"""Describes a Tautulli sensor."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
||||||
TautulliSensorEntityDescription(
|
TautulliSensorEntityDescription(
|
||||||
key="watching_count",
|
key="watching_count",
|
||||||
@ -145,20 +138,13 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class TautulliSessionSensorEntityMixin:
|
class TautulliSessionSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for Tautulli session sensor."""
|
"""Describes a Tautulli session sensor."""
|
||||||
|
|
||||||
value_fn: Callable[[PyTautulliApiSession], StateType]
|
value_fn: Callable[[PyTautulliApiSession], StateType]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TautulliSessionSensorEntityDescription(
|
|
||||||
SensorEntityDescription, TautulliSessionSensorEntityMixin
|
|
||||||
):
|
|
||||||
"""Describes a Tautulli session sensor."""
|
|
||||||
|
|
||||||
|
|
||||||
SESSION_SENSOR_TYPES: tuple[TautulliSessionSensorEntityDescription, ...] = (
|
SESSION_SENSOR_TYPES: tuple[TautulliSessionSensorEntityDescription, ...] = (
|
||||||
TautulliSessionSensorEntityDescription(
|
TautulliSessionSensorEntityDescription(
|
||||||
key="state",
|
key="state",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user