Remove entity description mixin in Meater (#112904)
This commit is contained in:
parent
2349ce1abd
commit
9fd96e8a78
1 changed files with 3 additions and 10 deletions
|
@ -28,21 +28,14 @@ from homeassistant.util import dt as dt_util
|
|||
from .const import DOMAIN
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class MeaterSensorEntityDescriptionMixin:
|
||||
"""Mixin for MeaterSensorEntityDescription."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class MeaterSensorEntityDescription(SensorEntityDescription):
|
||||
"""Describes meater sensor entity."""
|
||||
|
||||
available: Callable[[MeaterProbe | None], bool]
|
||||
value: Callable[[MeaterProbe], datetime | float | str | None]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class MeaterSensorEntityDescription(
|
||||
SensorEntityDescription, MeaterSensorEntityDescriptionMixin
|
||||
):
|
||||
"""Describes meater sensor entity."""
|
||||
|
||||
|
||||
def _elapsed_time_to_timestamp(probe: MeaterProbe) -> datetime | None:
|
||||
"""Convert elapsed time to timestamp."""
|
||||
if not probe.cook or not hasattr(probe.cook, "time_elapsed"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue