mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Remove entity description mixin in EnergyZero (#112412)
This commit is contained in:
parent
0153c1840f
commit
86503526ee
@ -29,21 +29,14 @@ from .const import DOMAIN, SERVICE_TYPE_DEVICE_NAMES
|
|||||||
from .coordinator import EnergyZeroData, EnergyZeroDataUpdateCoordinator
|
from .coordinator import EnergyZeroData, EnergyZeroDataUpdateCoordinator
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EnergyZeroSensorEntityDescriptionMixin:
|
class EnergyZeroSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes an EnergyZero sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[EnergyZeroData], float | datetime | None]
|
value_fn: Callable[[EnergyZeroData], float | datetime | None]
|
||||||
service_type: str
|
service_type: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EnergyZeroSensorEntityDescription(
|
|
||||||
SensorEntityDescription, EnergyZeroSensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes a Pure Energie sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSORS: tuple[EnergyZeroSensorEntityDescription, ...] = (
|
SENSORS: tuple[EnergyZeroSensorEntityDescription, ...] = (
|
||||||
EnergyZeroSensorEntityDescription(
|
EnergyZeroSensorEntityDescription(
|
||||||
key="current_hour_price",
|
key="current_hour_price",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user