mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +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
|
return self.coordinator.data.get(self.entity_description.metric_key) == 1
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class ValloxMetricKeyMixin:
|
class ValloxBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||||
"""Dataclass to allow defining metric_key without a default value."""
|
"""Describes Vallox binary sensor entity."""
|
||||||
|
|
||||||
metric_key: str
|
metric_key: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class ValloxBinarySensorEntityDescription(
|
|
||||||
BinarySensorEntityDescription, ValloxMetricKeyMixin
|
|
||||||
):
|
|
||||||
"""Describes Vallox binary sensor entity."""
|
|
||||||
|
|
||||||
|
|
||||||
BINARY_SENSOR_ENTITIES: tuple[ValloxBinarySensorEntityDescription, ...] = (
|
BINARY_SENSOR_ENTITIES: tuple[ValloxBinarySensorEntityDescription, ...] = (
|
||||||
ValloxBinarySensorEntityDescription(
|
ValloxBinarySensorEntityDescription(
|
||||||
key="post_heater",
|
key="post_heater",
|
||||||
|
@ -59,18 +59,13 @@ class ValloxNumberEntity(ValloxEntity, NumberEntity):
|
|||||||
await self.coordinator.async_request_refresh()
|
await self.coordinator.async_request_refresh()
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class ValloxMetricMixin:
|
class ValloxNumberEntityDescription(NumberEntityDescription):
|
||||||
"""Holds Vallox metric key."""
|
"""Describes Vallox number entity."""
|
||||||
|
|
||||||
metric_key: str
|
metric_key: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class ValloxNumberEntityDescription(NumberEntityDescription, ValloxMetricMixin):
|
|
||||||
"""Describes Vallox number entity."""
|
|
||||||
|
|
||||||
|
|
||||||
NUMBER_ENTITIES: tuple[ValloxNumberEntityDescription, ...] = (
|
NUMBER_ENTITIES: tuple[ValloxNumberEntityDescription, ...] = (
|
||||||
ValloxNumberEntityDescription(
|
ValloxNumberEntityDescription(
|
||||||
key="supply_air_target_home",
|
key="supply_air_target_home",
|
||||||
|
@ -62,18 +62,13 @@ class ValloxSwitchEntity(ValloxEntity, SwitchEntity):
|
|||||||
await self.coordinator.async_request_refresh()
|
await self.coordinator.async_request_refresh()
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
class ValloxMetricKeyMixin:
|
class ValloxSwitchEntityDescription(SwitchEntityDescription):
|
||||||
"""Dataclass to allow defining metric_key without a default value."""
|
"""Describes Vallox switch entity."""
|
||||||
|
|
||||||
metric_key: str
|
metric_key: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
|
||||||
class ValloxSwitchEntityDescription(SwitchEntityDescription, ValloxMetricKeyMixin):
|
|
||||||
"""Describes Vallox switch entity."""
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_ENTITIES: tuple[ValloxSwitchEntityDescription, ...] = (
|
SWITCH_ENTITIES: tuple[ValloxSwitchEntityDescription, ...] = (
|
||||||
ValloxSwitchEntityDescription(
|
ValloxSwitchEntityDescription(
|
||||||
key="bypass_locked",
|
key="bypass_locked",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user