mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove entity description mixin in AirNow (#112376)
This commit is contained in:
parent
7e5a59756e
commit
153b1947fa
@ -51,19 +51,14 @@ ATTR_LEVEL = "level"
|
|||||||
ATTR_STATION = "reporting_station"
|
ATTR_STATION = "reporting_station"
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class AirNowEntityDescriptionMixin:
|
class AirNowEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes Airnow sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[Any], StateType]
|
value_fn: Callable[[Any], StateType]
|
||||||
extra_state_attributes_fn: Callable[[Any], dict[str, str]] | None
|
extra_state_attributes_fn: Callable[[Any], dict[str, str]] | None
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class AirNowEntityDescription(SensorEntityDescription, AirNowEntityDescriptionMixin):
|
|
||||||
"""Describes Airnow sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
def station_extra_attrs(data: dict[str, Any]) -> dict[str, Any]:
|
def station_extra_attrs(data: dict[str, Any]) -> dict[str, Any]:
|
||||||
"""Process extra attributes for station location (if available)."""
|
"""Process extra attributes for station location (if available)."""
|
||||||
if ATTR_API_STATION in data:
|
if ATTR_API_STATION in data:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user