Remove entity description mixin in Sensibo (#112936)

This commit is contained in:
Joost Lekkerkerker 2024-03-10 18:17:43 +01:00 committed by GitHub
parent 5f4881cb28
commit 049f0f5e3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 90 deletions

View file

@ -25,34 +25,20 @@ from .entity import SensiboDeviceBaseEntity, SensiboMotionBaseEntity
PARALLEL_UPDATES = 0
@dataclass(frozen=True)
class MotionBaseEntityDescriptionMixin:
"""Mixin for required Sensibo base description keys."""
@dataclass(frozen=True, kw_only=True)
class SensiboMotionBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Describes Sensibo Motion sensor entity."""
value_fn: Callable[[MotionSensor], bool | None]
@dataclass(frozen=True)
class DeviceBaseEntityDescriptionMixin:
"""Mixin for required Sensibo base description keys."""
@dataclass(frozen=True, kw_only=True)
class SensiboDeviceBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Describes Sensibo Motion sensor entity."""
value_fn: Callable[[SensiboDevice], bool | None]
@dataclass(frozen=True)
class SensiboMotionBinarySensorEntityDescription(
BinarySensorEntityDescription, MotionBaseEntityDescriptionMixin
):
"""Describes Sensibo Motion sensor entity."""
@dataclass(frozen=True)
class SensiboDeviceBinarySensorEntityDescription(
BinarySensorEntityDescription, DeviceBaseEntityDescriptionMixin
):
"""Describes Sensibo Motion sensor entity."""
FILTER_CLEAN_REQUIRED_DESCRIPTION = SensiboDeviceBinarySensorEntityDescription(
key="filter_clean",
translation_key="filter_clean",