mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Remove entity description mixin in EasyEnergy (#112407)
This commit is contained in:
parent
807c3ca76b
commit
0153c1840f
@ -29,21 +29,14 @@ from .const import DOMAIN, SERVICE_TYPE_DEVICE_NAMES
|
|||||||
from .coordinator import EasyEnergyData, EasyEnergyDataUpdateCoordinator
|
from .coordinator import EasyEnergyData, EasyEnergyDataUpdateCoordinator
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class EasyEnergySensorEntityDescriptionMixin:
|
class EasyEnergySensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes easyEnergy sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[EasyEnergyData], float | datetime | None]
|
value_fn: Callable[[EasyEnergyData], float | datetime | None]
|
||||||
service_type: str
|
service_type: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class EasyEnergySensorEntityDescription(
|
|
||||||
SensorEntityDescription, EasyEnergySensorEntityDescriptionMixin
|
|
||||||
):
|
|
||||||
"""Describes easyEnergy sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SENSORS: tuple[EasyEnergySensorEntityDescription, ...] = (
|
SENSORS: tuple[EasyEnergySensorEntityDescription, ...] = (
|
||||||
EasyEnergySensorEntityDescription(
|
EasyEnergySensorEntityDescription(
|
||||||
key="current_hour_price",
|
key="current_hour_price",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user