Remove RDW entity descriptions required fields mixins (#103995)
This commit is contained in:
parent
2d36225405
commit
a101bb9354
2 changed files with 6 additions and 20 deletions
|
@ -23,20 +23,13 @@ from homeassistant.helpers.update_coordinator import (
|
|||
from .const import DOMAIN
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDWBinarySensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(kw_only=True)
|
||||
class RDWBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Describes RDW binary sensor entity."""
|
||||
|
||||
is_on_fn: Callable[[Vehicle], bool | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDWBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, RDWBinarySensorEntityDescriptionMixin
|
||||
):
|
||||
"""Describes RDW binary sensor entity."""
|
||||
|
||||
|
||||
BINARY_SENSORS: tuple[RDWBinarySensorEntityDescription, ...] = (
|
||||
RDWBinarySensorEntityDescription(
|
||||
key="liability_insured",
|
||||
|
|
|
@ -24,20 +24,13 @@ from homeassistant.helpers.update_coordinator import (
|
|||
from .const import CONF_LICENSE_PLATE, DOMAIN
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDWSensorEntityDescriptionMixin:
|
||||
"""Mixin for required keys."""
|
||||
@dataclass(kw_only=True)
|
||||
class RDWSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes RDW sensor entity."""
|
||||
|
||||
value_fn: Callable[[Vehicle], date | str | float | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDWSensorEntityDescription(
|
||||
SensorEntityDescription, RDWSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Describes RDW sensor entity."""
|
||||
|
||||
|
||||
SENSORS: tuple[RDWSensorEntityDescription, ...] = (
|
||||
RDWSensorEntityDescription(
|
||||
key="apk_expiration",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue