Remove entity description mixin in Permobil (#112918)
This commit is contained in:
parent
3f1b8eadd2
commit
cfc99af9ad
1 changed files with 3 additions and 10 deletions
|
@ -41,21 +41,14 @@ from .entity import PermobilEntity
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class PermobilRequiredKeysMixin:
|
class PermobilSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes Permobil sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[Any], float | int]
|
value_fn: Callable[[Any], float | int]
|
||||||
available_fn: Callable[[Any], bool]
|
available_fn: Callable[[Any], bool]
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class PermobilSensorEntityDescription(
|
|
||||||
SensorEntityDescription, PermobilRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""Describes Permobil sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSOR_DESCRIPTIONS: tuple[PermobilSensorEntityDescription, ...] = (
|
SENSOR_DESCRIPTIONS: tuple[PermobilSensorEntityDescription, ...] = (
|
||||||
PermobilSensorEntityDescription(
|
PermobilSensorEntityDescription(
|
||||||
# Current battery as a percentage
|
# Current battery as a percentage
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue