mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Remove Elgato entity descriptions required fields mixins (#103989)
This commit is contained in:
parent
3359619436
commit
a513511936
@ -23,20 +23,13 @@ from .coordinator import ElgatoDataUpdateCoordinator
|
||||
from .entity import ElgatoEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class ElgatoButtonEntityDescriptionMixin:
|
||||
"""Mixin values for Elgato entities."""
|
||||
@dataclass(kw_only=True)
|
||||
class ElgatoButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Class describing Elgato button entities."""
|
||||
|
||||
press_fn: Callable[[Elgato], Awaitable[Any]]
|
||||
|
||||
|
||||
@dataclass
|
||||
class ElgatoButtonEntityDescription(
|
||||
ButtonEntityDescription, ElgatoButtonEntityDescriptionMixin
|
||||
):
|
||||
"""Class describing Elgato button entities."""
|
||||
|
||||
|
||||
BUTTONS = [
|
||||
ElgatoButtonEntityDescription(
|
||||
key="identify",
|
||||
|
@ -26,20 +26,12 @@ from .coordinator import ElgatoData, ElgatoDataUpdateCoordinator
|
||||
from .entity import ElgatoEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class ElgatoEntityDescriptionMixin:
|
||||
"""Mixin values for Elgato entities."""
|
||||
|
||||
value_fn: Callable[[ElgatoData], float | int | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
class ElgatoSensorEntityDescription(
|
||||
SensorEntityDescription, ElgatoEntityDescriptionMixin
|
||||
):
|
||||
@dataclass(kw_only=True)
|
||||
class ElgatoSensorEntityDescription(SensorEntityDescription):
|
||||
"""Class describing Elgato sensor entities."""
|
||||
|
||||
has_fn: Callable[[ElgatoData], bool] = lambda _: True
|
||||
value_fn: Callable[[ElgatoData], float | int | None]
|
||||
|
||||
|
||||
SENSORS = [
|
||||
|
@ -19,21 +19,13 @@ from .coordinator import ElgatoData, ElgatoDataUpdateCoordinator
|
||||
from .entity import ElgatoEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class ElgatoEntityDescriptionMixin:
|
||||
"""Mixin values for Elgato entities."""
|
||||
|
||||
is_on_fn: Callable[[ElgatoData], bool | None]
|
||||
set_fn: Callable[[Elgato, bool], Awaitable[Any]]
|
||||
|
||||
|
||||
@dataclass
|
||||
class ElgatoSwitchEntityDescription(
|
||||
SwitchEntityDescription, ElgatoEntityDescriptionMixin
|
||||
):
|
||||
@dataclass(kw_only=True)
|
||||
class ElgatoSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Class describing Elgato switch entities."""
|
||||
|
||||
has_fn: Callable[[ElgatoData], bool] = lambda _: True
|
||||
is_on_fn: Callable[[ElgatoData], bool | None]
|
||||
set_fn: Callable[[Elgato, bool], Awaitable[Any]]
|
||||
|
||||
|
||||
SWITCHES = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user