mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Remove entity description mixin in Tradfri (#112953)
This commit is contained in:
parent
7ea1f42b84
commit
83dc99cd9e
@ -38,21 +38,13 @@ from .const import (
|
|||||||
from .coordinator import TradfriDeviceDataUpdateCoordinator
|
from .coordinator import TradfriDeviceDataUpdateCoordinator
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class TradfriSensorEntityDescriptionMixin:
|
class TradfriSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Class describing Tradfri sensor entities."""
|
||||||
|
|
||||||
value: Callable[[Device], Any | None]
|
value: Callable[[Device], Any | None]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class TradfriSensorEntityDescription(
|
|
||||||
SensorEntityDescription,
|
|
||||||
TradfriSensorEntityDescriptionMixin,
|
|
||||||
):
|
|
||||||
"""Class describing Tradfri sensor entities."""
|
|
||||||
|
|
||||||
|
|
||||||
def _get_air_quality(device: Device) -> int | None:
|
def _get_air_quality(device: Device) -> int | None:
|
||||||
"""Fetch the air quality value."""
|
"""Fetch the air quality value."""
|
||||||
assert device.air_purifier_control is not None
|
assert device.air_purifier_control is not None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user