mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Remove entity description mixin in SFR Box (#112937)
This commit is contained in:
parent
f668dfecb2
commit
ae003c21c8
@ -27,20 +27,13 @@ from .models import DomainData
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SFRBoxBinarySensorMixin(Generic[_T]):
|
||||
"""Mixin for SFR Box sensors."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SFRBoxBinarySensorEntityDescription(BinarySensorEntityDescription, Generic[_T]):
|
||||
"""Description for SFR Box binary sensors."""
|
||||
|
||||
value_fn: Callable[[_T], bool | None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SFRBoxBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, SFRBoxBinarySensorMixin[_T]
|
||||
):
|
||||
"""Description for SFR Box binary sensors."""
|
||||
|
||||
|
||||
DSL_SENSOR_TYPES: tuple[SFRBoxBinarySensorEntityDescription[DslInfo], ...] = (
|
||||
SFRBoxBinarySensorEntityDescription[DslInfo](
|
||||
key="status",
|
||||
|
@ -50,18 +50,13 @@ def with_error_wrapping(
|
||||
return wrapper
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SFRBoxButtonMixin:
|
||||
"""Mixin for SFR Box buttons."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SFRBoxButtonEntityDescription(ButtonEntityDescription):
|
||||
"""Description for SFR Box buttons."""
|
||||
|
||||
async_press: Callable[[SFRBox], Coroutine[None, None, None]]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SFRBoxButtonEntityDescription(ButtonEntityDescription, SFRBoxButtonMixin):
|
||||
"""Description for SFR Box buttons."""
|
||||
|
||||
|
||||
BUTTON_TYPES: tuple[SFRBoxButtonEntityDescription, ...] = (
|
||||
SFRBoxButtonEntityDescription(
|
||||
async_press=lambda x: x.system_reboot(),
|
||||
|
@ -33,18 +33,13 @@ from .models import DomainData
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SFRBoxSensorMixin(Generic[_T]):
|
||||
"""Mixin for SFR Box sensors."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SFRBoxSensorEntityDescription(SensorEntityDescription, Generic[_T]):
|
||||
"""Description for SFR Box sensors."""
|
||||
|
||||
value_fn: Callable[[_T], StateType]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SFRBoxSensorEntityDescription(SensorEntityDescription, SFRBoxSensorMixin[_T]):
|
||||
"""Description for SFR Box sensors."""
|
||||
|
||||
|
||||
DSL_SENSOR_TYPES: tuple[SFRBoxSensorEntityDescription[DslInfo], ...] = (
|
||||
SFRBoxSensorEntityDescription[DslInfo](
|
||||
key="linemode",
|
||||
|
Loading…
x
Reference in New Issue
Block a user