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
|
from .entity import RensonEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class RensonBinarySensorEntityDescriptionMixin:
|
class RensonBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Description of binary sensor."""
|
||||||
|
|
||||||
field: FieldEnum
|
field: FieldEnum
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class RensonBinarySensorEntityDescription(
|
|
||||||
BinarySensorEntityDescription, RensonBinarySensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Description of binary sensor."""
|
|
||||||
|
|
||||||
|
|
||||||
BINARY_SENSORS: tuple[RensonBinarySensorEntityDescription, ...] = (
|
BINARY_SENSORS: tuple[RensonBinarySensorEntityDescription, ...] = (
|
||||||
RensonBinarySensorEntityDescription(
|
RensonBinarySensorEntityDescription(
|
||||||
translation_key="frost_protection_active",
|
translation_key="frost_protection_active",
|
||||||
|
|
|
@ -22,20 +22,13 @@ from .const import DOMAIN
|
||||||
from .entity import RensonEntity
|
from .entity import RensonEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class RensonButtonEntityDescriptionMixin:
|
class RensonButtonEntityDescription(ButtonEntityDescription):
|
||||||
"""Action function called on press."""
|
"""Class describing Renson button entity."""
|
||||||
|
|
||||||
action_fn: Callable[[RensonVentilation], None]
|
action_fn: Callable[[RensonVentilation], None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class RensonButtonEntityDescription(
|
|
||||||
ButtonEntityDescription, RensonButtonEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Renson button entity."""
|
|
||||||
|
|
||||||
|
|
||||||
ENTITY_DESCRIPTIONS: tuple[RensonButtonEntityDescription, ...] = (
|
ENTITY_DESCRIPTIONS: tuple[RensonButtonEntityDescription, ...] = (
|
||||||
RensonButtonEntityDescription(
|
RensonButtonEntityDescription(
|
||||||
key="sync_time",
|
key="sync_time",
|
||||||
|
|
|
@ -51,21 +51,14 @@ from .coordinator import RensonCoordinator
|
||||||
from .entity import RensonEntity
|
from .entity import RensonEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class RensonSensorEntityDescriptionMixin:
|
class RensonSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Description of a Renson sensor."""
|
||||||
|
|
||||||
field: FieldEnum
|
field: FieldEnum
|
||||||
raw_format: bool
|
raw_format: bool
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class RensonSensorEntityDescription(
|
|
||||||
SensorEntityDescription, RensonSensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Description of a Renson sensor."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSORS: tuple[RensonSensorEntityDescription, ...] = (
|
SENSORS: tuple[RensonSensorEntityDescription, ...] = (
|
||||||
RensonSensorEntityDescription(
|
RensonSensorEntityDescription(
|
||||||
key="CO2_QUALITY_FIELD",
|
key="CO2_QUALITY_FIELD",
|
||||||
|
|
Loading…
Add table
Reference in a new issue