mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Remove entity description mixin in BAF (#112386)
This commit is contained in:
parent
fc732ecf17
commit
f03be2fd9e
@ -21,20 +21,14 @@ from .entity import BAFEntity
|
|||||||
from .models import BAFData
|
from .models import BAFData
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class BAFBinarySensorDescriptionMixin:
|
|
||||||
"""Required values for BAF binary sensors."""
|
|
||||||
|
|
||||||
value_fn: Callable[[Device], bool | None]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class BAFBinarySensorDescription(
|
class BAFBinarySensorDescription(
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
BAFBinarySensorDescriptionMixin,
|
|
||||||
):
|
):
|
||||||
"""Class describing BAF binary sensor entities."""
|
"""Class describing BAF binary sensor entities."""
|
||||||
|
|
||||||
|
value_fn: Callable[[Device], bool | None]
|
||||||
|
|
||||||
|
|
||||||
OCCUPANCY_SENSORS = (
|
OCCUPANCY_SENSORS = (
|
||||||
BAFBinarySensorDescription(
|
BAFBinarySensorDescription(
|
||||||
|
@ -22,18 +22,13 @@ from .entity import BAFEntity
|
|||||||
from .models import BAFData
|
from .models import BAFData
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class BAFNumberDescriptionMixin:
|
class BAFNumberDescription(NumberEntityDescription):
|
||||||
"""Required values for BAF sensors."""
|
"""Class describing BAF sensor entities."""
|
||||||
|
|
||||||
value_fn: Callable[[Device], int | None]
|
value_fn: Callable[[Device], int | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class BAFNumberDescription(NumberEntityDescription, BAFNumberDescriptionMixin):
|
|
||||||
"""Class describing BAF sensor entities."""
|
|
||||||
|
|
||||||
|
|
||||||
AUTO_COMFORT_NUMBER_DESCRIPTIONS = (
|
AUTO_COMFORT_NUMBER_DESCRIPTIONS = (
|
||||||
BAFNumberDescription(
|
BAFNumberDescription(
|
||||||
key="comfort_min_speed",
|
key="comfort_min_speed",
|
||||||
|
@ -28,20 +28,14 @@ from .entity import BAFEntity
|
|||||||
from .models import BAFData
|
from .models import BAFData
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class BAFSensorDescriptionMixin:
|
|
||||||
"""Required values for BAF sensors."""
|
|
||||||
|
|
||||||
value_fn: Callable[[Device], int | float | str | None]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class BAFSensorDescription(
|
class BAFSensorDescription(
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
BAFSensorDescriptionMixin,
|
|
||||||
):
|
):
|
||||||
"""Class describing BAF sensor entities."""
|
"""Class describing BAF sensor entities."""
|
||||||
|
|
||||||
|
value_fn: Callable[[Device], int | float | str | None]
|
||||||
|
|
||||||
|
|
||||||
AUTO_COMFORT_SENSORS = (
|
AUTO_COMFORT_SENSORS = (
|
||||||
BAFSensorDescription(
|
BAFSensorDescription(
|
||||||
|
@ -18,20 +18,14 @@ from .entity import BAFEntity
|
|||||||
from .models import BAFData
|
from .models import BAFData
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class BAFSwitchDescriptionMixin:
|
|
||||||
"""Required values for BAF sensors."""
|
|
||||||
|
|
||||||
value_fn: Callable[[Device], bool | None]
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class BAFSwitchDescription(
|
class BAFSwitchDescription(
|
||||||
SwitchEntityDescription,
|
SwitchEntityDescription,
|
||||||
BAFSwitchDescriptionMixin,
|
|
||||||
):
|
):
|
||||||
"""Class describing BAF switch entities."""
|
"""Class describing BAF switch entities."""
|
||||||
|
|
||||||
|
value_fn: Callable[[Device], bool | None]
|
||||||
|
|
||||||
|
|
||||||
BASE_SWITCHES = [
|
BASE_SWITCHES = [
|
||||||
BAFSwitchDescription(
|
BAFSwitchDescription(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user