mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Remove entity description mixin in Meater (#112904)
This commit is contained in:
parent
2349ce1abd
commit
9fd96e8a78
@ -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…
x
Reference in New Issue
Block a user