Remove entity description mixin in AirNow (#112376)
This commit is contained in:
parent
7e5a59756e
commit
153b1947fa
1 changed files with 3 additions and 8 deletions
|
@ -51,19 +51,14 @@ ATTR_LEVEL = "level"
|
|||
ATTR_STATION = "reporting_station"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AirNowEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class AirNowEntityDescription(SensorEntityDescription):
|
||||
"""Describes Airnow sensor entity."""
|
||||
|
||||
value_fn: Callable[[Any], StateType]
|
||||
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]:
|
||||
"""Process extra attributes for station location (if available)."""
|
||||
if ATTR_API_STATION in data:
|
||||
|
|
Loading…
Add table
Reference in a new issue