mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove entity description mixin in Sensibo (#112936)
This commit is contained in:
parent
5f4881cb28
commit
049f0f5e3b
@ -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",
|
||||
|
@ -18,20 +18,13 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboEntityDescriptionMixin:
|
||||
"""Mixin values for Sensibo entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensiboButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Class describing Sensibo Button entities."""
|
||||
|
||||
data_key: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboButtonEntityDescription(
|
||||
ButtonEntityDescription, SensiboEntityDescriptionMixin
|
||||
):
|
||||
"""Class describing Sensibo Button entities."""
|
||||
|
||||
|
||||
DEVICE_BUTTON_TYPES = SensiboButtonEntityDescription(
|
||||
key="reset_filter",
|
||||
translation_key="reset_filter",
|
||||
|
@ -25,21 +25,14 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboEntityDescriptionMixin:
|
||||
"""Mixin values for Sensibo entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensiboNumberEntityDescription(NumberEntityDescription):
|
||||
"""Class describing Sensibo Number entities."""
|
||||
|
||||
remote_key: str
|
||||
value_fn: Callable[[SensiboDevice], float | None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboNumberEntityDescription(
|
||||
NumberEntityDescription, SensiboEntityDescriptionMixin
|
||||
):
|
||||
"""Class describing Sensibo Number entities."""
|
||||
|
||||
|
||||
DEVICE_NUMBER_TYPES = (
|
||||
SensiboNumberEntityDescription(
|
||||
key="calibration_temp",
|
||||
|
@ -21,9 +21,9 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboSelectDescriptionMixin:
|
||||
"""Mixin values for Sensibo entities."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensiboSelectEntityDescription(SelectEntityDescription):
|
||||
"""Class describing Sensibo Select entities."""
|
||||
|
||||
data_key: str
|
||||
value_fn: Callable[[SensiboDevice], str | None]
|
||||
@ -31,13 +31,6 @@ class SensiboSelectDescriptionMixin:
|
||||
transformation: Callable[[SensiboDevice], dict | None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboSelectEntityDescription(
|
||||
SelectEntityDescription, SensiboSelectDescriptionMixin
|
||||
):
|
||||
"""Class describing Sensibo Select entities."""
|
||||
|
||||
|
||||
DEVICE_SELECT_TYPES = (
|
||||
SensiboSelectEntityDescription(
|
||||
key="horizontalSwing",
|
||||
|
@ -37,35 +37,21 @@ 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 SensiboMotionSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes Sensibo Motion sensor entity."""
|
||||
|
||||
value_fn: Callable[[MotionSensor], StateType]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DeviceBaseEntityDescriptionMixin:
|
||||
"""Mixin for required Sensibo base description keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensiboDeviceSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes Sensibo Device sensor entity."""
|
||||
|
||||
value_fn: Callable[[SensiboDevice], StateType | datetime]
|
||||
extra_fn: Callable[[SensiboDevice], dict[str, str | bool | None] | None] | None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboMotionSensorEntityDescription(
|
||||
SensorEntityDescription, MotionBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Describes Sensibo Motion sensor entity."""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboDeviceSensorEntityDescription(
|
||||
SensorEntityDescription, DeviceBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Describes Sensibo Device sensor entity."""
|
||||
|
||||
|
||||
FILTER_LAST_RESET_DESCRIPTION = SensiboDeviceSensorEntityDescription(
|
||||
key="filter_last_reset",
|
||||
translation_key="filter_last_reset",
|
||||
|
@ -25,9 +25,9 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DeviceBaseEntityDescriptionMixin:
|
||||
"""Mixin for required Sensibo Device description keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensiboDeviceSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Describes Sensibo Switch entity."""
|
||||
|
||||
value_fn: Callable[[SensiboDevice], bool | None]
|
||||
extra_fn: Callable[[SensiboDevice], dict[str, str | bool | None]] | None
|
||||
@ -36,13 +36,6 @@ class DeviceBaseEntityDescriptionMixin:
|
||||
data_key: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboDeviceSwitchEntityDescription(
|
||||
SwitchEntityDescription, DeviceBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Describes Sensibo Switch entity."""
|
||||
|
||||
|
||||
DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
|
||||
SensiboDeviceSwitchEntityDescription(
|
||||
key="timer_on_switch",
|
||||
|
@ -24,21 +24,14 @@ from .entity import SensiboDeviceBaseEntity
|
||||
PARALLEL_UPDATES = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DeviceBaseEntityDescriptionMixin:
|
||||
"""Mixin for required Sensibo base description keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SensiboDeviceUpdateEntityDescription(UpdateEntityDescription):
|
||||
"""Describes Sensibo Update entity."""
|
||||
|
||||
value_version: Callable[[SensiboDevice], str | None]
|
||||
value_available: Callable[[SensiboDevice], str | None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SensiboDeviceUpdateEntityDescription(
|
||||
UpdateEntityDescription, DeviceBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Describes Sensibo Update entity."""
|
||||
|
||||
|
||||
DEVICE_SENSOR_TYPES: tuple[SensiboDeviceUpdateEntityDescription, ...] = (
|
||||
SensiboDeviceUpdateEntityDescription(
|
||||
key="fw_ver_available",
|
||||
|
Loading…
x
Reference in New Issue
Block a user