diff --git a/homeassistant/components/ecoforest/number.py b/homeassistant/components/ecoforest/number.py index 79d62b6a2d2..046e780dc2b 100644 --- a/homeassistant/components/ecoforest/number.py +++ b/homeassistant/components/ecoforest/number.py @@ -16,20 +16,13 @@ from .coordinator import EcoforestCoordinator from .entity import EcoforestEntity -@dataclass(frozen=True) -class EcoforestRequiredKeysMixin: - """Mixin for required keys.""" +@dataclass(frozen=True, kw_only=True) +class EcoforestNumberEntityDescription(NumberEntityDescription): + """Describes an ecoforest number entity.""" value_fn: Callable[[Device], float | None] -@dataclass(frozen=True) -class EcoforestNumberEntityDescription( - NumberEntityDescription, EcoforestRequiredKeysMixin -): - """Describes an ecoforest number entity.""" - - NUMBER_ENTITIES = ( EcoforestNumberEntityDescription( key="power_level", diff --git a/homeassistant/components/ecoforest/sensor.py b/homeassistant/components/ecoforest/sensor.py index 90904d274ac..2b698602cff 100644 --- a/homeassistant/components/ecoforest/sensor.py +++ b/homeassistant/components/ecoforest/sensor.py @@ -33,20 +33,13 @@ STATUS_TYPE = [s.value for s in State] ALARM_TYPE = [a.value for a in Alarm] + ["none"] -@dataclass(frozen=True) -class EcoforestRequiredKeysMixin: - """Mixin for required keys.""" +@dataclass(frozen=True, kw_only=True) +class EcoforestSensorEntityDescription(SensorEntityDescription): + """Describes Ecoforest sensor entity.""" value_fn: Callable[[Device], StateType] -@dataclass(frozen=True) -class EcoforestSensorEntityDescription( - SensorEntityDescription, EcoforestRequiredKeysMixin -): - """Describes Ecoforest sensor entity.""" - - SENSOR_TYPES: tuple[EcoforestSensorEntityDescription, ...] = ( EcoforestSensorEntityDescription( key="temperature", diff --git a/homeassistant/components/ecoforest/switch.py b/homeassistant/components/ecoforest/switch.py index 1e70068cde8..378c27924ae 100644 --- a/homeassistant/components/ecoforest/switch.py +++ b/homeassistant/components/ecoforest/switch.py @@ -17,21 +17,14 @@ from .coordinator import EcoforestCoordinator from .entity import EcoforestEntity -@dataclass(frozen=True) -class EcoforestSwitchRequiredKeysMixin: - """Mixin for required keys.""" +@dataclass(frozen=True, kw_only=True) +class EcoforestSwitchEntityDescription(SwitchEntityDescription): + """Describes an Ecoforest switch entity.""" value_fn: Callable[[Device], bool] switch_fn: Callable[[EcoforestApi, bool], Awaitable[Device]] -@dataclass(frozen=True) -class EcoforestSwitchEntityDescription( - SwitchEntityDescription, EcoforestSwitchRequiredKeysMixin -): - """Describes an Ecoforest switch entity.""" - - SWITCH_TYPES: tuple[EcoforestSwitchEntityDescription, ...] = ( EcoforestSwitchEntityDescription( key="status",