diff --git a/homeassistant/components/homewizard/sensor.py b/homeassistant/components/homewizard/sensor.py index 84aa58f2d27..72b1027780a 100644 --- a/homeassistant/components/homewizard/sensor.py +++ b/homeassistant/components/homewizard/sensor.py @@ -35,21 +35,13 @@ from .entity import HomeWizardEntity PARALLEL_UPDATES = 1 -@dataclass -class HomeWizardEntityDescriptionMixin: - """Mixin values for HomeWizard entities.""" - - has_fn: Callable[[Data], bool] - value_fn: Callable[[Data], StateType] - - -@dataclass -class HomeWizardSensorEntityDescription( - SensorEntityDescription, HomeWizardEntityDescriptionMixin -): +@dataclass(kw_only=True) +class HomeWizardSensorEntityDescription(SensorEntityDescription): """Class describing HomeWizard sensor entities.""" enabled_fn: Callable[[Data], bool] = lambda data: True + has_fn: Callable[[Data], bool] + value_fn: Callable[[Data], StateType] SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = ( diff --git a/homeassistant/components/homewizard/switch.py b/homeassistant/components/homewizard/switch.py index ed59963aa41..3f854aad320 100644 --- a/homeassistant/components/homewizard/switch.py +++ b/homeassistant/components/homewizard/switch.py @@ -23,23 +23,15 @@ from .entity import HomeWizardEntity from .helpers import homewizard_exception_handler -@dataclass -class HomeWizardEntityDescriptionMixin: - """Mixin values for HomeWizard entities.""" - - create_fn: Callable[[HWEnergyDeviceUpdateCoordinator], bool] - available_fn: Callable[[DeviceResponseEntry], bool] - is_on_fn: Callable[[DeviceResponseEntry], bool | None] - set_fn: Callable[[HomeWizardEnergy, bool], Awaitable[Any]] - - -@dataclass -class HomeWizardSwitchEntityDescription( - SwitchEntityDescription, HomeWizardEntityDescriptionMixin -): +@dataclass(kw_only=True) +class HomeWizardSwitchEntityDescription(SwitchEntityDescription): """Class describing HomeWizard switch entities.""" + available_fn: Callable[[DeviceResponseEntry], bool] + create_fn: Callable[[HWEnergyDeviceUpdateCoordinator], bool] icon_off: str | None = None + is_on_fn: Callable[[DeviceResponseEntry], bool | None] + set_fn: Callable[[HomeWizardEnergy, bool], Awaitable[Any]] SWITCHES = [