Remove entity description mixin in Permobil (#112918)

This commit is contained in:
Joost Lekkerkerker 2024-03-10 19:50:20 +01:00 committed by GitHub
parent 3f1b8eadd2
commit cfc99af9ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,21 +41,14 @@ from .entity import PermobilEntity
_LOGGER = logging.getLogger(__name__)
@dataclass(frozen=True)
class PermobilRequiredKeysMixin:
"""Mixin for required keys."""
@dataclass(frozen=True, kw_only=True)
class PermobilSensorEntityDescription(SensorEntityDescription):
"""Describes Permobil sensor entity."""
value_fn: Callable[[Any], float | int]
available_fn: Callable[[Any], bool]
@dataclass(frozen=True)
class PermobilSensorEntityDescription(
SensorEntityDescription, PermobilRequiredKeysMixin
):
"""Describes Permobil sensor entity."""
SENSOR_DESCRIPTIONS: tuple[PermobilSensorEntityDescription, ...] = (
PermobilSensorEntityDescription(
# Current battery as a percentage