mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Remove entity description mixin in Vodafone Station (#112967)
This commit is contained in:
parent
afa69cca38
commit
5d231ed61f
@ -21,21 +21,14 @@ from .const import _LOGGER, DOMAIN
|
||||
from .coordinator import VodafoneStationRouter
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class VodafoneStationBaseEntityDescriptionMixin:
|
||||
"""Mixin to describe a Button entity."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class VodafoneStationEntityDescription(ButtonEntityDescription):
|
||||
"""Vodafone Station entity description."""
|
||||
|
||||
press_action: Callable[[VodafoneStationRouter], Any]
|
||||
is_suitable: Callable[[dict], bool]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class VodafoneStationEntityDescription(
|
||||
ButtonEntityDescription, VodafoneStationBaseEntityDescriptionMixin
|
||||
):
|
||||
"""Vodafone Station entity description."""
|
||||
|
||||
|
||||
BUTTON_TYPES: Final = (
|
||||
VodafoneStationEntityDescription(
|
||||
key="reboot",
|
||||
|
@ -25,9 +25,9 @@ from .coordinator import VodafoneStationRouter
|
||||
NOT_AVAILABLE: list = ["", "N/A", "0.0.0.0"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class VodafoneStationBaseEntityDescription:
|
||||
"""Vodafone Station entity base description."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class VodafoneStationEntityDescription(SensorEntityDescription):
|
||||
"""Vodafone Station entity description."""
|
||||
|
||||
value: Callable[[Any, Any], Any] = (
|
||||
lambda coordinator, key: coordinator.data.sensors[key]
|
||||
@ -35,13 +35,6 @@ class VodafoneStationBaseEntityDescription:
|
||||
is_suitable: Callable[[dict], bool] = lambda val: True
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class VodafoneStationEntityDescription(
|
||||
VodafoneStationBaseEntityDescription, SensorEntityDescription
|
||||
):
|
||||
"""Vodafone Station entity description."""
|
||||
|
||||
|
||||
def _calculate_uptime(coordinator: VodafoneStationRouter, key: str) -> datetime:
|
||||
"""Calculate device uptime."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user