mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Remove HomeWizard entity descriptions required fields mixins (#103994)
This commit is contained in:
parent
8df7291abb
commit
cfac6d18f3
@ -35,21 +35,13 @@ from .entity import HomeWizardEntity
|
|||||||
PARALLEL_UPDATES = 1
|
PARALLEL_UPDATES = 1
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(kw_only=True)
|
||||||
class HomeWizardEntityDescriptionMixin:
|
class HomeWizardSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin values for HomeWizard entities."""
|
|
||||||
|
|
||||||
has_fn: Callable[[Data], bool]
|
|
||||||
value_fn: Callable[[Data], StateType]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class HomeWizardSensorEntityDescription(
|
|
||||||
SensorEntityDescription, HomeWizardEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing HomeWizard sensor entities."""
|
"""Class describing HomeWizard sensor entities."""
|
||||||
|
|
||||||
enabled_fn: Callable[[Data], bool] = lambda data: True
|
enabled_fn: Callable[[Data], bool] = lambda data: True
|
||||||
|
has_fn: Callable[[Data], bool]
|
||||||
|
value_fn: Callable[[Data], StateType]
|
||||||
|
|
||||||
|
|
||||||
SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = (
|
SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = (
|
||||||
|
@ -23,23 +23,15 @@ from .entity import HomeWizardEntity
|
|||||||
from .helpers import homewizard_exception_handler
|
from .helpers import homewizard_exception_handler
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(kw_only=True)
|
||||||
class HomeWizardEntityDescriptionMixin:
|
class HomeWizardSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""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
|
|
||||||
):
|
|
||||||
"""Class describing HomeWizard switch entities."""
|
"""Class describing HomeWizard switch entities."""
|
||||||
|
|
||||||
|
available_fn: Callable[[DeviceResponseEntry], bool]
|
||||||
|
create_fn: Callable[[HWEnergyDeviceUpdateCoordinator], bool]
|
||||||
icon_off: str | None = None
|
icon_off: str | None = None
|
||||||
|
is_on_fn: Callable[[DeviceResponseEntry], bool | None]
|
||||||
|
set_fn: Callable[[HomeWizardEnergy, bool], Awaitable[Any]]
|
||||||
|
|
||||||
|
|
||||||
SWITCHES = [
|
SWITCHES = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user