Fix yolink entity descriptions (#106649)
This commit is contained in:
parent
c1e37a4cc3
commit
5f3389b8e4
1 changed files with 4 additions and 12 deletions
|
@ -48,21 +48,13 @@ from .coordinator import YoLinkCoordinator
|
||||||
from .entity import YoLinkEntity
|
from .entity import YoLinkEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class YoLinkSensorEntityDescriptionMixin:
|
class YoLinkSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for device type."""
|
|
||||||
|
|
||||||
exists_fn: Callable[[YoLinkDevice], bool] = lambda _: True
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class YoLinkSensorEntityDescription(
|
|
||||||
YoLinkSensorEntityDescriptionMixin, SensorEntityDescription
|
|
||||||
):
|
|
||||||
"""YoLink SensorEntityDescription."""
|
"""YoLink SensorEntityDescription."""
|
||||||
|
|
||||||
value: Callable = lambda state: state
|
exists_fn: Callable[[YoLinkDevice], bool] = lambda _: True
|
||||||
should_update_entity: Callable = lambda state: True
|
should_update_entity: Callable = lambda state: True
|
||||||
|
value: Callable = lambda state: state
|
||||||
|
|
||||||
|
|
||||||
SENSOR_DEVICE_TYPE = [
|
SENSOR_DEVICE_TYPE = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue