Remove entity description mixin in Renson (#112926)
This commit is contained in:
parent
54abc4935f
commit
7730c3bcf3
3 changed files with 9 additions and 30 deletions
|
@ -31,20 +31,13 @@ from .coordinator import RensonCoordinator
|
|||
from .entity import RensonEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RensonBinarySensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class RensonBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Description of binary sensor."""
|
||||
|
||||
field: FieldEnum
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RensonBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, RensonBinarySensorEntityDescriptionMixin
|
||||
):
|
||||
"""Description of binary sensor."""
|
||||
|
||||
|
||||
BINARY_SENSORS: tuple[RensonBinarySensorEntityDescription, ...] = (
|
||||
RensonBinarySensorEntityDescription(
|
||||
translation_key="frost_protection_active",
|
||||
|
|
|
@ -22,20 +22,13 @@ from .const import DOMAIN
|
|||
from .entity import RensonEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RensonButtonEntityDescriptionMixin:
|
||||
"""Action function called on press."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class RensonButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Class describing Renson button entity."""
|
||||
|
||||
action_fn: Callable[[RensonVentilation], None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RensonButtonEntityDescription(
|
||||
ButtonEntityDescription, RensonButtonEntityDescriptionMixin
|
||||
):
|
||||
"""Class describing Renson button entity."""
|
||||
|
||||
|
||||
ENTITY_DESCRIPTIONS: tuple[RensonButtonEntityDescription, ...] = (
|
||||
RensonButtonEntityDescription(
|
||||
key="sync_time",
|
||||
|
|
|
@ -51,21 +51,14 @@ from .coordinator import RensonCoordinator
|
|||
from .entity import RensonEntity
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RensonSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class RensonSensorEntityDescription(SensorEntityDescription):
|
||||
"""Description of a Renson sensor."""
|
||||
|
||||
field: FieldEnum
|
||||
raw_format: bool
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RensonSensorEntityDescription(
|
||||
SensorEntityDescription, RensonSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Description of a Renson sensor."""
|
||||
|
||||
|
||||
SENSORS: tuple[RensonSensorEntityDescription, ...] = (
|
||||
RensonSensorEntityDescription(
|
||||
key="CO2_QUALITY_FIELD",
|
||||
|
|
Loading…
Add table
Reference in a new issue