Remove Deconz entity descriptions required fields mixins (#104009)

This commit is contained in:
Franck Nijhof 2023-11-16 16:05:29 +01:00 committed by GitHub
parent b400b33b0d
commit 2c003d8c10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 42 deletions

View file

@ -91,22 +91,16 @@ T = TypeVar(
)
@dataclass
class DeconzSensorDescriptionMixin(Generic[T]):
"""Required values when describing secondary sensor attributes."""
supported_fn: Callable[[T], bool]
update_key: str
value_fn: Callable[[T], datetime | StateType]
@dataclass
class DeconzSensorDescription(SensorEntityDescription, DeconzSensorDescriptionMixin[T]):
@dataclass(kw_only=True)
class DeconzSensorDescription(Generic[T], SensorEntityDescription):
"""Class describing deCONZ binary sensor entities."""
instance_check: type[T] | None = None
name_suffix: str = ""
old_unique_id_suffix: str = ""
supported_fn: Callable[[T], bool]
update_key: str
value_fn: Callable[[T], datetime | StateType]
ENTITY_DESCRIPTIONS: tuple[DeconzSensorDescription, ...] = (