Remove entity description mixin in Github (#112771)

pull/113071/head
Joost Lekkerkerker 2024-03-11 15:12:24 +01:00 committed by GitHub
parent d939c48b4a
commit e13d8200cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 14 deletions

View File

@ -23,27 +23,16 @@ from .const import DOMAIN
from .coordinator import GitHubDataUpdateCoordinator
@dataclass(frozen=True)
class BaseEntityDescriptionMixin:
"""Mixin for required GitHub base description keys."""
@dataclass(frozen=True, kw_only=True)
class GitHubSensorEntityDescription(SensorEntityDescription):
"""Describes GitHub issue sensor entity."""
value_fn: Callable[[dict[str, Any]], StateType]
@dataclass(frozen=True)
class BaseEntityDescription(SensorEntityDescription):
"""Describes GitHub sensor entity default overrides."""
icon: str = "mdi:github"
attr_fn: Callable[[dict[str, Any]], Mapping[str, Any] | None] = lambda data: None
avabl_fn: Callable[[dict[str, Any]], bool] = lambda data: True
@dataclass(frozen=True)
class GitHubSensorEntityDescription(BaseEntityDescription, BaseEntityDescriptionMixin):
"""Describes GitHub issue sensor entity."""
SENSOR_DESCRIPTIONS: tuple[GitHubSensorEntityDescription, ...] = (
GitHubSensorEntityDescription(
key="discussions_count",