mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Remove entity description mixin in NextDNS (#116456)
Remove entity description mixin Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
parent
feb6cfdd56
commit
f9b1b371e9
@ -25,20 +25,14 @@ from .coordinator import CoordinatorDataT, NextDnsConnectionUpdateCoordinator
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NextDnsBinarySensorRequiredKeysMixin(Generic[CoordinatorDataT]):
|
||||
"""Mixin for required keys."""
|
||||
|
||||
state: Callable[[CoordinatorDataT, str], bool]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class NextDnsBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription,
|
||||
NextDnsBinarySensorRequiredKeysMixin[CoordinatorDataT],
|
||||
BinarySensorEntityDescription, Generic[CoordinatorDataT]
|
||||
):
|
||||
"""NextDNS binary sensor entity description."""
|
||||
|
||||
state: Callable[[CoordinatorDataT, str], bool]
|
||||
|
||||
|
||||
SENSORS = (
|
||||
NextDnsBinarySensorEntityDescription[ConnectionStatus](
|
||||
|
@ -39,22 +39,16 @@ from .coordinator import CoordinatorDataT, NextDnsUpdateCoordinator
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NextDnsSensorRequiredKeysMixin(Generic[CoordinatorDataT]):
|
||||
"""Class for NextDNS entity required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class NextDnsSensorEntityDescription(
|
||||
SensorEntityDescription, Generic[CoordinatorDataT]
|
||||
):
|
||||
"""NextDNS sensor entity description."""
|
||||
|
||||
coordinator_type: str
|
||||
value: Callable[[CoordinatorDataT], StateType]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NextDnsSensorEntityDescription(
|
||||
SensorEntityDescription,
|
||||
NextDnsSensorRequiredKeysMixin[CoordinatorDataT],
|
||||
):
|
||||
"""NextDNS sensor entity description."""
|
||||
|
||||
|
||||
SENSORS: tuple[NextDnsSensorEntityDescription, ...] = (
|
||||
NextDnsSensorEntityDescription[AnalyticsStatus](
|
||||
key="all_queries",
|
||||
|
@ -24,19 +24,14 @@ from .coordinator import CoordinatorDataT, NextDnsSettingsUpdateCoordinator
|
||||
PARALLEL_UPDATES = 1
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NextDnsSwitchRequiredKeysMixin(Generic[CoordinatorDataT]):
|
||||
"""Class for NextDNS entity required keys."""
|
||||
|
||||
state: Callable[[CoordinatorDataT], bool]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class NextDnsSwitchEntityDescription(
|
||||
SwitchEntityDescription, NextDnsSwitchRequiredKeysMixin[CoordinatorDataT]
|
||||
SwitchEntityDescription, Generic[CoordinatorDataT]
|
||||
):
|
||||
"""NextDNS switch entity description."""
|
||||
|
||||
state: Callable[[CoordinatorDataT], bool]
|
||||
|
||||
|
||||
SWITCHES = (
|
||||
NextDnsSwitchEntityDescription[Settings](
|
||||
|
Loading…
x
Reference in New Issue
Block a user