mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +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
|
from .entity import ElgatoEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(kw_only=True)
|
||||||
class ElgatoButtonEntityDescriptionMixin:
|
class ElgatoButtonEntityDescription(ButtonEntityDescription):
|
||||||
"""Mixin values for Elgato entities."""
|
"""Class describing Elgato button entities."""
|
||||||
|
|
||||||
press_fn: Callable[[Elgato], Awaitable[Any]]
|
press_fn: Callable[[Elgato], Awaitable[Any]]
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class ElgatoButtonEntityDescription(
|
|
||||||
ButtonEntityDescription, ElgatoButtonEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Elgato button entities."""
|
|
||||||
|
|
||||||
|
|
||||||
BUTTONS = [
|
BUTTONS = [
|
||||||
ElgatoButtonEntityDescription(
|
ElgatoButtonEntityDescription(
|
||||||
key="identify",
|
key="identify",
|
||||||
|
@ -26,20 +26,12 @@ from .coordinator import ElgatoData, ElgatoDataUpdateCoordinator
|
|||||||
from .entity import ElgatoEntity
|
from .entity import ElgatoEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(kw_only=True)
|
||||||
class ElgatoEntityDescriptionMixin:
|
class ElgatoSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin values for Elgato entities."""
|
|
||||||
|
|
||||||
value_fn: Callable[[ElgatoData], float | int | None]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class ElgatoSensorEntityDescription(
|
|
||||||
SensorEntityDescription, ElgatoEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Elgato sensor entities."""
|
"""Class describing Elgato sensor entities."""
|
||||||
|
|
||||||
has_fn: Callable[[ElgatoData], bool] = lambda _: True
|
has_fn: Callable[[ElgatoData], bool] = lambda _: True
|
||||||
|
value_fn: Callable[[ElgatoData], float | int | None]
|
||||||
|
|
||||||
|
|
||||||
SENSORS = [
|
SENSORS = [
|
||||||
|
@ -19,21 +19,13 @@ from .coordinator import ElgatoData, ElgatoDataUpdateCoordinator
|
|||||||
from .entity import ElgatoEntity
|
from .entity import ElgatoEntity
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(kw_only=True)
|
||||||
class ElgatoEntityDescriptionMixin:
|
class ElgatoSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Mixin values for Elgato entities."""
|
|
||||||
|
|
||||||
is_on_fn: Callable[[ElgatoData], bool | None]
|
|
||||||
set_fn: Callable[[Elgato, bool], Awaitable[Any]]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class ElgatoSwitchEntityDescription(
|
|
||||||
SwitchEntityDescription, ElgatoEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Class describing Elgato switch entities."""
|
"""Class describing Elgato switch entities."""
|
||||||
|
|
||||||
has_fn: Callable[[ElgatoData], bool] = lambda _: True
|
has_fn: Callable[[ElgatoData], bool] = lambda _: True
|
||||||
|
is_on_fn: Callable[[ElgatoData], bool | None]
|
||||||
|
set_fn: Callable[[Elgato, bool], Awaitable[Any]]
|
||||||
|
|
||||||
|
|
||||||
SWITCHES = [
|
SWITCHES = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user