From 1bc6277c47ec091fd197882e5d86a6406e1f609e Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 11 Mar 2024 11:56:03 +0100 Subject: [PATCH] Remove entity description mixin in Tautulli (#112949) --- homeassistant/components/tautulli/sensor.py | 26 +++++---------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/tautulli/sensor.py b/homeassistant/components/tautulli/sensor.py index f28aaddde25..f0d274bbe12 100644 --- a/homeassistant/components/tautulli/sensor.py +++ b/homeassistant/components/tautulli/sensor.py @@ -44,20 +44,13 @@ def get_top_stats( return value -@dataclass(frozen=True) -class TautulliSensorEntityMixin: - """Mixin for Tautulli sensor.""" +@dataclass(frozen=True, kw_only=True) +class TautulliSensorEntityDescription(SensorEntityDescription): + """Describes a Tautulli sensor.""" value_fn: Callable[[PyTautulliApiHomeStats, PyTautulliApiActivity, str], StateType] -@dataclass(frozen=True) -class TautulliSensorEntityDescription( - SensorEntityDescription, TautulliSensorEntityMixin -): - """Describes a Tautulli sensor.""" - - SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = ( TautulliSensorEntityDescription( key="watching_count", @@ -145,20 +138,13 @@ SENSOR_TYPES: tuple[TautulliSensorEntityDescription, ...] = ( ) -@dataclass(frozen=True) -class TautulliSessionSensorEntityMixin: - """Mixin for Tautulli session sensor.""" +@dataclass(frozen=True, kw_only=True) +class TautulliSessionSensorEntityDescription(SensorEntityDescription): + """Describes a Tautulli session sensor.""" value_fn: Callable[[PyTautulliApiSession], StateType] -@dataclass(frozen=True) -class TautulliSessionSensorEntityDescription( - SensorEntityDescription, TautulliSessionSensorEntityMixin -): - """Describes a Tautulli session sensor.""" - - SESSION_SENSOR_TYPES: tuple[TautulliSessionSensorEntityDescription, ...] = ( TautulliSessionSensorEntityDescription( key="state",