From 24b7f03e3104bb550a200dea067058709ddb7b85 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sat, 9 Mar 2024 16:05:07 +0100 Subject: [PATCH] Remove entity description mixin in idasen desk (#112780) --- homeassistant/components/idasen_desk/button.py | 13 +++---------- homeassistant/components/idasen_desk/sensor.py | 14 +++----------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/homeassistant/components/idasen_desk/button.py b/homeassistant/components/idasen_desk/button.py index 7119d890a64..0de3125576d 100644 --- a/homeassistant/components/idasen_desk/button.py +++ b/homeassistant/components/idasen_desk/button.py @@ -18,22 +18,15 @@ from .const import DOMAIN _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) -class IdasenDeskButtonDescriptionMixin: - """Mixin to describe a IdasenDesk button entity.""" +@dataclass(frozen=True, kw_only=True) +class IdasenDeskButtonDescription(ButtonEntityDescription): + """Class to describe a IdasenDesk button entity.""" press_action: Callable[ [IdasenDeskCoordinator], Callable[[], Coroutine[Any, Any, Any]] ] -@dataclass(frozen=True) -class IdasenDeskButtonDescription( - ButtonEntityDescription, IdasenDeskButtonDescriptionMixin -): - """Class to describe a IdasenDesk button entity.""" - - BUTTONS: Final = [ IdasenDeskButtonDescription( key="connect", diff --git a/homeassistant/components/idasen_desk/sensor.py b/homeassistant/components/idasen_desk/sensor.py index fcbdbc6c25e..12a3b2ed4d9 100644 --- a/homeassistant/components/idasen_desk/sensor.py +++ b/homeassistant/components/idasen_desk/sensor.py @@ -23,21 +23,13 @@ from . import DeskData, IdasenDeskCoordinator from .const import DOMAIN -@dataclass(frozen=True) -class IdasenDeskSensorDescriptionMixin: - """Required values for IdasenDesk sensors.""" +@dataclass(frozen=True, kw_only=True) +class IdasenDeskSensorDescription(SensorEntityDescription): + """Class describing IdasenDesk sensor entities.""" value_fn: Callable[[IdasenDeskCoordinator], float | None] -@dataclass(frozen=True) -class IdasenDeskSensorDescription( - SensorEntityDescription, - IdasenDeskSensorDescriptionMixin, -): - """Class describing IdasenDesk sensor entities.""" - - SENSORS = ( IdasenDeskSensorDescription( key="height",