diff --git a/homeassistant/components/bmw_connected_drive/binary_sensor.py b/homeassistant/components/bmw_connected_drive/binary_sensor.py index 7ff9ad2d8ab..e7886d79cad 100644 --- a/homeassistant/components/bmw_connected_drive/binary_sensor.py +++ b/homeassistant/components/bmw_connected_drive/binary_sensor.py @@ -109,19 +109,11 @@ def _format_cbs_report( return result -@dataclass(frozen=True) -class BMWRequiredKeysMixin: - """Mixin for required keys.""" - - value_fn: Callable[[MyBMWVehicle], bool] - - -@dataclass(frozen=True) -class BMWBinarySensorEntityDescription( - BinarySensorEntityDescription, BMWRequiredKeysMixin -): +@dataclass(frozen=True, kw_only=True) +class BMWBinarySensorEntityDescription(BinarySensorEntityDescription): """Describes BMW binary_sensor entity.""" + value_fn: Callable[[MyBMWVehicle], bool] attr_fn: Callable[[MyBMWVehicle, UnitSystem], dict[str, Any]] | None = None diff --git a/homeassistant/components/bmw_connected_drive/button.py b/homeassistant/components/bmw_connected_drive/button.py index 74f12c9c721..8ef0ac3d3ef 100644 --- a/homeassistant/components/bmw_connected_drive/button.py +++ b/homeassistant/components/bmw_connected_drive/button.py @@ -25,17 +25,11 @@ if TYPE_CHECKING: _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) -class BMWRequiredKeysMixin: - """Mixin for required keys.""" - - remote_function: Callable[[MyBMWVehicle], Coroutine[Any, Any, RemoteServiceStatus]] - - -@dataclass(frozen=True) -class BMWButtonEntityDescription(ButtonEntityDescription, BMWRequiredKeysMixin): +@dataclass(frozen=True, kw_only=True) +class BMWButtonEntityDescription(ButtonEntityDescription): """Class describing BMW button entities.""" + remote_function: Callable[[MyBMWVehicle], Coroutine[Any, Any, RemoteServiceStatus]] enabled_when_read_only: bool = False is_available: Callable[[MyBMWVehicle], bool] = lambda _: True diff --git a/homeassistant/components/bmw_connected_drive/number.py b/homeassistant/components/bmw_connected_drive/number.py index 21326a59118..defeb3f0f56 100644 --- a/homeassistant/components/bmw_connected_drive/number.py +++ b/homeassistant/components/bmw_connected_drive/number.py @@ -26,18 +26,12 @@ from .coordinator import BMWDataUpdateCoordinator _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) -class BMWRequiredKeysMixin: - """Mixin for required keys.""" +@dataclass(frozen=True, kw_only=True) +class BMWNumberEntityDescription(NumberEntityDescription): + """Describes BMW number entity.""" value_fn: Callable[[MyBMWVehicle], float | int | None] remote_service: Callable[[MyBMWVehicle, float | int], Coroutine[Any, Any, Any]] - - -@dataclass(frozen=True) -class BMWNumberEntityDescription(NumberEntityDescription, BMWRequiredKeysMixin): - """Describes BMW number entity.""" - is_available: Callable[[MyBMWVehicle], bool] = lambda _: False dynamic_options: Callable[[MyBMWVehicle], list[str]] | None = None diff --git a/homeassistant/components/bmw_connected_drive/select.py b/homeassistant/components/bmw_connected_drive/select.py index db426b89487..24172857e70 100644 --- a/homeassistant/components/bmw_connected_drive/select.py +++ b/homeassistant/components/bmw_connected_drive/select.py @@ -22,18 +22,12 @@ from .coordinator import BMWDataUpdateCoordinator _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) -class BMWRequiredKeysMixin: - """Mixin for required keys.""" +@dataclass(frozen=True, kw_only=True) +class BMWSelectEntityDescription(SelectEntityDescription): + """Describes BMW sensor entity.""" current_option: Callable[[MyBMWVehicle], str] remote_service: Callable[[MyBMWVehicle, str], Coroutine[Any, Any, Any]] - - -@dataclass(frozen=True) -class BMWSelectEntityDescription(SelectEntityDescription, BMWRequiredKeysMixin): - """Describes BMW sensor entity.""" - is_available: Callable[[MyBMWVehicle], bool] = lambda _: False dynamic_options: Callable[[MyBMWVehicle], list[str]] | None = None diff --git a/homeassistant/components/bmw_connected_drive/switch.py b/homeassistant/components/bmw_connected_drive/switch.py index 7c8952f4ecc..5ee31d2efd7 100644 --- a/homeassistant/components/bmw_connected_drive/switch.py +++ b/homeassistant/components/bmw_connected_drive/switch.py @@ -22,19 +22,13 @@ from .coordinator import BMWDataUpdateCoordinator _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) -class BMWRequiredKeysMixin: - """Mixin for required keys.""" +@dataclass(frozen=True, kw_only=True) +class BMWSwitchEntityDescription(SwitchEntityDescription): + """Describes BMW switch entity.""" value_fn: Callable[[MyBMWVehicle], bool] remote_service_on: Callable[[MyBMWVehicle], Coroutine[Any, Any, Any]] remote_service_off: Callable[[MyBMWVehicle], Coroutine[Any, Any, Any]] - - -@dataclass(frozen=True) -class BMWSwitchEntityDescription(SwitchEntityDescription, BMWRequiredKeysMixin): - """Describes BMW switch entity.""" - is_available: Callable[[MyBMWVehicle], bool] = lambda _: False dynamic_options: Callable[[MyBMWVehicle], list[str]] | None = None