1
mirror of https://github.com/home-assistant/core synced 2024-07-15 09:42:11 +02:00

Fix yolink entity descriptions (#106649)

This commit is contained in:
Erik Montnemery 2023-12-29 13:22:06 +01:00 committed by GitHub
parent 853e4d87fa
commit 95d7a66c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = [