mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Remove entity description mixin in Vallox (#112963)
This commit is contained in:
parent
39bfb2b5ba
commit
b5c5db9ca0
@ -42,20 +42,13 @@ class ValloxBinarySensorEntity(ValloxEntity, BinarySensorEntity):
|
||||
return self.coordinator.data.get(self.entity_description.metric_key) == 1
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ValloxMetricKeyMixin:
|
||||
"""Dataclass to allow defining metric_key without a default value."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ValloxBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Describes Vallox binary sensor entity."""
|
||||
|
||||
metric_key: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ValloxBinarySensorEntityDescription(
|
||||
BinarySensorEntityDescription, ValloxMetricKeyMixin
|
||||
):
|
||||
"""Describes Vallox binary sensor entity."""
|
||||
|
||||
|
||||
BINARY_SENSOR_ENTITIES: tuple[ValloxBinarySensorEntityDescription, ...] = (
|
||||
ValloxBinarySensorEntityDescription(
|
||||
key="post_heater",
|
||||
|
@ -59,18 +59,13 @@ class ValloxNumberEntity(ValloxEntity, NumberEntity):
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ValloxMetricMixin:
|
||||
"""Holds Vallox metric key."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ValloxNumberEntityDescription(NumberEntityDescription):
|
||||
"""Describes Vallox number entity."""
|
||||
|
||||
metric_key: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ValloxNumberEntityDescription(NumberEntityDescription, ValloxMetricMixin):
|
||||
"""Describes Vallox number entity."""
|
||||
|
||||
|
||||
NUMBER_ENTITIES: tuple[ValloxNumberEntityDescription, ...] = (
|
||||
ValloxNumberEntityDescription(
|
||||
key="supply_air_target_home",
|
||||
|
@ -62,18 +62,13 @@ class ValloxSwitchEntity(ValloxEntity, SwitchEntity):
|
||||
await self.coordinator.async_request_refresh()
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ValloxMetricKeyMixin:
|
||||
"""Dataclass to allow defining metric_key without a default value."""
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class ValloxSwitchEntityDescription(SwitchEntityDescription):
|
||||
"""Describes Vallox switch entity."""
|
||||
|
||||
metric_key: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ValloxSwitchEntityDescription(SwitchEntityDescription, ValloxMetricKeyMixin):
|
||||
"""Describes Vallox switch entity."""
|
||||
|
||||
|
||||
SWITCH_ENTITIES: tuple[ValloxSwitchEntityDescription, ...] = (
|
||||
ValloxSwitchEntityDescription(
|
||||
key="bypass_locked",
|
||||
|
Loading…
x
Reference in New Issue
Block a user