Remove entity description mixin in Melcloud (#112905)
This commit is contained in:
parent
69a322a6f2
commit
f37bb6b1bf
1 changed files with 3 additions and 10 deletions
|
@ -24,21 +24,14 @@ from . import MelCloudDevice
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(frozen=True)
|
@dataclasses.dataclass(frozen=True, kw_only=True)
|
||||||
class MelcloudRequiredKeysMixin:
|
class MelcloudSensorEntityDescription(SensorEntityDescription):
|
||||||
"""Mixin for required keys."""
|
"""Describes Melcloud sensor entity."""
|
||||||
|
|
||||||
value_fn: Callable[[Any], float]
|
value_fn: Callable[[Any], float]
|
||||||
enabled: Callable[[Any], bool]
|
enabled: Callable[[Any], bool]
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(frozen=True)
|
|
||||||
class MelcloudSensorEntityDescription(
|
|
||||||
SensorEntityDescription, MelcloudRequiredKeysMixin
|
|
||||||
):
|
|
||||||
"""Describes Melcloud sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
ATA_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
ATA_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
||||||
MelcloudSensorEntityDescription(
|
MelcloudSensorEntityDescription(
|
||||||
key="room_temperature",
|
key="room_temperature",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue