Remove entity description mixin in Tado (#112947)

This commit is contained in:
Joost Lekkerkerker 2024-03-11 10:53:19 +01:00 committed by GitHub
parent d0f53c2c99
commit a0d50ecdf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 20 deletions

View File

@ -34,19 +34,12 @@ from .entity import TadoDeviceEntity, TadoZoneEntity
_LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True)
class TadoBinarySensorEntityDescriptionMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class TadoBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Describes Tado binary sensor entity."""
state_fn: Callable[[Any], bool]
@dataclass(frozen=True)
class TadoBinarySensorEntityDescription(
BinarySensorEntityDescription, TadoBinarySensorEntityDescriptionMixin
):
"""Describes Tado binary sensor entity."""
attributes_fn: Callable[[Any], dict[Any, StateType]] | None = None

View File

@ -37,19 +37,12 @@ from .entity import TadoHomeEntity, TadoZoneEntity
_LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True)
class TadoSensorEntityDescriptionMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class TadoSensorEntityDescription(SensorEntityDescription):
"""Describes Tado sensor entity."""
state_fn: Callable[[Any], StateType]
@dataclass(frozen=True)
class TadoSensorEntityDescription(
SensorEntityDescription, TadoSensorEntityDescriptionMixin
):
"""Describes Tado sensor entity."""
attributes_fn: Callable[[Any], dict[Any, StateType]] | None = None
data_category: str | None = None