diff --git a/homeassistant/components/sensibo/binary_sensor.py b/homeassistant/components/sensibo/binary_sensor.py index fa0ea9231f930c..a34c7884ac7b9c 100644 --- a/homeassistant/components/sensibo/binary_sensor.py +++ b/homeassistant/components/sensibo/binary_sensor.py @@ -25,32 +25,18 @@ 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.""" - - value_fn: Callable[[SensiboDevice], bool | None] - - -@dataclass(frozen=True) -class SensiboMotionBinarySensorEntityDescription( - BinarySensorEntityDescription, MotionBaseEntityDescriptionMixin -): +@dataclass(frozen=True, kw_only=True) +class SensiboDeviceBinarySensorEntityDescription(BinarySensorEntityDescription): """Describes Sensibo Motion sensor entity.""" - -@dataclass(frozen=True) -class SensiboDeviceBinarySensorEntityDescription( - BinarySensorEntityDescription, DeviceBaseEntityDescriptionMixin -): - """Describes Sensibo Motion sensor entity.""" + value_fn: Callable[[SensiboDevice], bool | None] FILTER_CLEAN_REQUIRED_DESCRIPTION = SensiboDeviceBinarySensorEntityDescription( diff --git a/homeassistant/components/sensibo/button.py b/homeassistant/components/sensibo/button.py index f6d540f54d1f82..fbfabaa97fb470 100644 --- a/homeassistant/components/sensibo/button.py +++ b/homeassistant/components/sensibo/button.py @@ -18,20 +18,13 @@ 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", diff --git a/homeassistant/components/sensibo/number.py b/homeassistant/components/sensibo/number.py index 3550066404110e..9c7b97ff79fdf1 100644 --- a/homeassistant/components/sensibo/number.py +++ b/homeassistant/components/sensibo/number.py @@ -25,21 +25,14 @@ 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", diff --git a/homeassistant/components/sensibo/select.py b/homeassistant/components/sensibo/select.py index 97fce5ae832f99..f3f8f55fc8e1df 100644 --- a/homeassistant/components/sensibo/select.py +++ b/homeassistant/components/sensibo/select.py @@ -21,9 +21,9 @@ 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", diff --git a/homeassistant/components/sensibo/sensor.py b/homeassistant/components/sensibo/sensor.py index b58be0e5bdf9eb..0a2b23b2cd9fee 100644 --- a/homeassistant/components/sensibo/sensor.py +++ b/homeassistant/components/sensibo/sensor.py @@ -37,35 +37,21 @@ 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", diff --git a/homeassistant/components/sensibo/switch.py b/homeassistant/components/sensibo/switch.py index 7edb2d3f72e9f6..b4e3dbf13fdaf3 100644 --- a/homeassistant/components/sensibo/switch.py +++ b/homeassistant/components/sensibo/switch.py @@ -25,9 +25,9 @@ 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", diff --git a/homeassistant/components/sensibo/update.py b/homeassistant/components/sensibo/update.py index 13c89e8c9bff35..9376cd1eb38205 100644 --- a/homeassistant/components/sensibo/update.py +++ b/homeassistant/components/sensibo/update.py @@ -24,21 +24,14 @@ 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",