From 95d7a66c16a1e3526bd3f575380b03e7e385116f Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 29 Dec 2023 13:22:06 +0100 Subject: [PATCH] Fix yolink entity descriptions (#106649) --- homeassistant/components/yolink/sensor.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/yolink/sensor.py b/homeassistant/components/yolink/sensor.py index 4ac9379d763c..ace133533411 100644 --- a/homeassistant/components/yolink/sensor.py +++ b/homeassistant/components/yolink/sensor.py @@ -48,21 +48,13 @@ from .coordinator import YoLinkCoordinator from .entity import YoLinkEntity -@dataclass(frozen=True) -class YoLinkSensorEntityDescriptionMixin: - """Mixin for device type.""" - - exists_fn: Callable[[YoLinkDevice], bool] = lambda _: True - - -@dataclass(frozen=True) -class YoLinkSensorEntityDescription( - YoLinkSensorEntityDescriptionMixin, SensorEntityDescription -): +@dataclass(frozen=True, kw_only=True) +class YoLinkSensorEntityDescription(SensorEntityDescription): """YoLink SensorEntityDescription.""" - value: Callable = lambda state: state + exists_fn: Callable[[YoLinkDevice], bool] = lambda _: True should_update_entity: Callable = lambda state: True + value: Callable = lambda state: state SENSOR_DEVICE_TYPE = [