mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove Withings entity descriptions required fields mixins (#104008)
This commit is contained in:
parent
182c40f16e
commit
8df7291abb
@ -58,20 +58,13 @@ from .coordinator import (
|
||||
from .entity import WithingsEntity
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsMeasurementSensorEntityDescriptionMixin:
|
||||
"""Mixin for describing withings data."""
|
||||
@dataclass(kw_only=True)
|
||||
class WithingsMeasurementSensorEntityDescription(SensorEntityDescription):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
measurement_type: MeasurementType
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsMeasurementSensorEntityDescription(
|
||||
SensorEntityDescription, WithingsMeasurementSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
|
||||
MEASUREMENT_SENSORS: dict[
|
||||
MeasurementType, WithingsMeasurementSensorEntityDescription
|
||||
] = {
|
||||
@ -243,20 +236,13 @@ MEASUREMENT_SENSORS: dict[
|
||||
}
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsSleepSensorEntityDescriptionMixin:
|
||||
"""Mixin for describing withings data."""
|
||||
@dataclass(kw_only=True)
|
||||
class WithingsSleepSensorEntityDescription(SensorEntityDescription):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
value_fn: Callable[[SleepSummary], StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsSleepSensorEntityDescription(
|
||||
SensorEntityDescription, WithingsSleepSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
|
||||
SLEEP_SENSORS = [
|
||||
WithingsSleepSensorEntityDescription(
|
||||
key="sleep_breathing_disturbances_intensity",
|
||||
@ -410,20 +396,13 @@ SLEEP_SENSORS = [
|
||||
]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsActivitySensorEntityDescriptionMixin:
|
||||
"""Mixin for describing withings data."""
|
||||
@dataclass(kw_only=True)
|
||||
class WithingsActivitySensorEntityDescription(SensorEntityDescription):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
value_fn: Callable[[Activity], StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsActivitySensorEntityDescription(
|
||||
SensorEntityDescription, WithingsActivitySensorEntityDescriptionMixin
|
||||
):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
|
||||
ACTIVITY_SENSORS = [
|
||||
WithingsActivitySensorEntityDescription(
|
||||
key="activity_steps_today",
|
||||
@ -514,20 +493,13 @@ SLEEP_GOAL = "sleep"
|
||||
WEIGHT_GOAL = "weight"
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsGoalsSensorEntityDescriptionMixin:
|
||||
"""Mixin for describing withings data."""
|
||||
@dataclass(kw_only=True)
|
||||
class WithingsGoalsSensorEntityDescription(SensorEntityDescription):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
value_fn: Callable[[Goals], StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsGoalsSensorEntityDescription(
|
||||
SensorEntityDescription, WithingsGoalsSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
|
||||
GOALS_SENSORS: dict[str, WithingsGoalsSensorEntityDescription] = {
|
||||
STEP_GOAL: WithingsGoalsSensorEntityDescription(
|
||||
key="step_goal",
|
||||
@ -558,20 +530,13 @@ GOALS_SENSORS: dict[str, WithingsGoalsSensorEntityDescription] = {
|
||||
}
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsWorkoutSensorEntityDescriptionMixin:
|
||||
"""Mixin for describing withings data."""
|
||||
@dataclass(kw_only=True)
|
||||
class WithingsWorkoutSensorEntityDescription(SensorEntityDescription):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
value_fn: Callable[[Workout], StateType]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WithingsWorkoutSensorEntityDescription(
|
||||
SensorEntityDescription, WithingsWorkoutSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Immutable class for describing withings data."""
|
||||
|
||||
|
||||
_WORKOUT_CATEGORY = [
|
||||
workout_category.name.lower() for workout_category in WorkoutCategory
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user