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
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class MotionBaseEntityDescriptionMixin:
|
class SensiboMotionBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Mixin for required Sensibo base description keys."""
|
"""Describes Sensibo Motion sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[MotionSensor], bool | None]
|
value_fn: Callable[[MotionSensor], bool | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class DeviceBaseEntityDescriptionMixin:
|
class SensiboDeviceBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Mixin for required Sensibo base description keys."""
|
"""Describes Sensibo Motion sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[SensiboDevice], bool | None]
|
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(
|
FILTER_CLEAN_REQUIRED_DESCRIPTION = SensiboDeviceBinarySensorEntityDescription(
|
||||||
key="filter_clean",
|
key="filter_clean",
|
||||||
translation_key="filter_clean",
|
translation_key="filter_clean",
|
||||||
|
@ -18,20 +18,13 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class SensiboEntityDescriptionMixin:
|
class SensiboButtonEntityDescription(ButtonEntityDescription):
|
||||||
"""Mixin values for Sensibo entities."""
|
"""Class describing Sensibo Button entities."""
|
||||||
|
|
||||||
data_key: str
|
data_key: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SensiboButtonEntityDescription(
|
|
||||||
ButtonEntityDescription, SensiboEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Sensibo Button entities."""
|
|
||||||
|
|
||||||
|
|
||||||
DEVICE_BUTTON_TYPES = SensiboButtonEntityDescription(
|
DEVICE_BUTTON_TYPES = SensiboButtonEntityDescription(
|
||||||
key="reset_filter",
|
key="reset_filter",
|
||||||
translation_key="reset_filter",
|
translation_key="reset_filter",
|
||||||
|
@ -25,21 +25,14 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class SensiboEntityDescriptionMixin:
|
class SensiboNumberEntityDescription(NumberEntityDescription):
|
||||||
"""Mixin values for Sensibo entities."""
|
"""Class describing Sensibo Number entities."""
|
||||||
|
|
||||||
remote_key: str
|
remote_key: str
|
||||||
value_fn: Callable[[SensiboDevice], float | None]
|
value_fn: Callable[[SensiboDevice], float | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SensiboNumberEntityDescription(
|
|
||||||
NumberEntityDescription, SensiboEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Sensibo Number entities."""
|
|
||||||
|
|
||||||
|
|
||||||
DEVICE_NUMBER_TYPES = (
|
DEVICE_NUMBER_TYPES = (
|
||||||
SensiboNumberEntityDescription(
|
SensiboNumberEntityDescription(
|
||||||
key="calibration_temp",
|
key="calibration_temp",
|
||||||
|
@ -21,9 +21,9 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class SensiboSelectDescriptionMixin:
|
class SensiboSelectEntityDescription(SelectEntityDescription):
|
||||||
"""Mixin values for Sensibo entities."""
|
"""Class describing Sensibo Select entities."""
|
||||||
|
|
||||||
data_key: str
|
data_key: str
|
||||||
value_fn: Callable[[SensiboDevice], str | None]
|
value_fn: Callable[[SensiboDevice], str | None]
|
||||||
@ -31,13 +31,6 @@ class SensiboSelectDescriptionMixin:
|
|||||||
transformation: Callable[[SensiboDevice], dict | None]
|
transformation: Callable[[SensiboDevice], dict | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SensiboSelectEntityDescription(
|
|
||||||
SelectEntityDescription, SensiboSelectDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Sensibo Select entities."""
|
|
||||||
|
|
||||||
|
|
||||||
DEVICE_SELECT_TYPES = (
|
DEVICE_SELECT_TYPES = (
|
||||||
SensiboSelectEntityDescription(
|
SensiboSelectEntityDescription(
|
||||||
key="horizontalSwing",
|
key="horizontalSwing",
|
||||||
|
@ -37,35 +37,21 @@ from .entity import SensiboDeviceBaseEntity, SensiboMotionBaseEntity
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class MotionBaseEntityDescriptionMixin:
|
class SensiboMotionSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required Sensibo base description keys."""
|
"""Describes Sensibo Motion sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[MotionSensor], StateType]
|
value_fn: Callable[[MotionSensor], StateType]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class DeviceBaseEntityDescriptionMixin:
|
class SensiboDeviceSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required Sensibo base description keys."""
|
"""Describes Sensibo Device sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[SensiboDevice], StateType | datetime]
|
value_fn: Callable[[SensiboDevice], StateType | datetime]
|
||||||
extra_fn: Callable[[SensiboDevice], dict[str, str | bool | None] | None] | None
|
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(
|
FILTER_LAST_RESET_DESCRIPTION = SensiboDeviceSensorEntityDescription(
|
||||||
key="filter_last_reset",
|
key="filter_last_reset",
|
||||||
translation_key="filter_last_reset",
|
translation_key="filter_last_reset",
|
||||||
|
@ -25,9 +25,9 @@ from .entity import SensiboDeviceBaseEntity, async_handle_api_call
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class DeviceBaseEntityDescriptionMixin:
|
class SensiboDeviceSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin for required Sensibo Device description keys."""
|
"""Describes Sensibo Switch entity."""
|
||||||
|
|
||||||
value_fn: Callable[[SensiboDevice], bool | None]
|
value_fn: Callable[[SensiboDevice], bool | None]
|
||||||
extra_fn: Callable[[SensiboDevice], dict[str, str | bool | None]] | None
|
extra_fn: Callable[[SensiboDevice], dict[str, str | bool | None]] | None
|
||||||
@ -36,13 +36,6 @@ class DeviceBaseEntityDescriptionMixin:
|
|||||||
data_key: str
|
data_key: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class SensiboDeviceSwitchEntityDescription(
|
|
||||||
SwitchEntityDescription, DeviceBaseEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes Sensibo Switch entity."""
|
|
||||||
|
|
||||||
|
|
||||||
DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
|
DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
|
||||||
SensiboDeviceSwitchEntityDescription(
|
SensiboDeviceSwitchEntityDescription(
|
||||||
key="timer_on_switch",
|
key="timer_on_switch",
|
||||||
|
@ -24,21 +24,14 @@ from .entity import SensiboDeviceBaseEntity
|
|||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class DeviceBaseEntityDescriptionMixin:
|
class SensiboDeviceUpdateEntityDescription(UpdateEntityDescription):
|
||||||
"""Mixin for required Sensibo base description keys."""
|
"""Describes Sensibo Update entity."""
|
||||||
|
|
||||||
value_version: Callable[[SensiboDevice], str | None]
|
value_version: Callable[[SensiboDevice], str | None]
|
||||||
value_available: 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, ...] = (
|
DEVICE_SENSOR_TYPES: tuple[SensiboDeviceUpdateEntityDescription, ...] = (
|
||||||
SensiboDeviceUpdateEntityDescription(
|
SensiboDeviceUpdateEntityDescription(
|
||||||
key="fw_ver_available",
|
key="fw_ver_available",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user