mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Migrate Vallox to new entity naming style (#75025)
This commit is contained in:
parent
5489b2111a
commit
cf612c4bec
@ -21,6 +21,7 @@ class ValloxBinarySensor(ValloxEntity, BinarySensorEntity):
|
|||||||
|
|
||||||
entity_description: ValloxBinarySensorEntityDescription
|
entity_description: ValloxBinarySensorEntityDescription
|
||||||
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -33,7 +34,6 @@ class ValloxBinarySensor(ValloxEntity, BinarySensorEntity):
|
|||||||
|
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
|
|
||||||
self._attr_name = f"{name} {description.name}"
|
|
||||||
self._attr_unique_id = f"{self._device_uuid}-{description.key}"
|
self._attr_unique_id = f"{self._device_uuid}-{description.key}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -59,7 +59,7 @@ class ValloxBinarySensorEntityDescription(
|
|||||||
SENSORS: tuple[ValloxBinarySensorEntityDescription, ...] = (
|
SENSORS: tuple[ValloxBinarySensorEntityDescription, ...] = (
|
||||||
ValloxBinarySensorEntityDescription(
|
ValloxBinarySensorEntityDescription(
|
||||||
key="post_heater",
|
key="post_heater",
|
||||||
name="Post Heater",
|
name="Post heater",
|
||||||
icon="mdi:radiator",
|
icon="mdi:radiator",
|
||||||
metric_key="A_CYC_IO_HEATER",
|
metric_key="A_CYC_IO_HEATER",
|
||||||
),
|
),
|
||||||
|
@ -83,6 +83,7 @@ class ValloxFan(ValloxEntity, FanEntity):
|
|||||||
"""Representation of the fan."""
|
"""Representation of the fan."""
|
||||||
|
|
||||||
_attr_supported_features = FanEntityFeature.PRESET_MODE
|
_attr_supported_features = FanEntityFeature.PRESET_MODE
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -95,7 +96,6 @@ class ValloxFan(ValloxEntity, FanEntity):
|
|||||||
|
|
||||||
self._client = client
|
self._client = client
|
||||||
|
|
||||||
self._attr_name = name
|
|
||||||
self._attr_unique_id = str(self._device_uuid)
|
self._attr_unique_id = str(self._device_uuid)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -37,6 +37,7 @@ class ValloxSensor(ValloxEntity, SensorEntity):
|
|||||||
|
|
||||||
entity_description: ValloxSensorEntityDescription
|
entity_description: ValloxSensorEntityDescription
|
||||||
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -49,7 +50,6 @@ class ValloxSensor(ValloxEntity, SensorEntity):
|
|||||||
|
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
|
|
||||||
self._attr_name = f"{name} {description.name}"
|
|
||||||
self._attr_unique_id = f"{self._device_uuid}-{description.key}"
|
self._attr_unique_id = f"{self._device_uuid}-{description.key}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -129,13 +129,13 @@ class ValloxSensorEntityDescription(SensorEntityDescription):
|
|||||||
SENSORS: tuple[ValloxSensorEntityDescription, ...] = (
|
SENSORS: tuple[ValloxSensorEntityDescription, ...] = (
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="current_profile",
|
key="current_profile",
|
||||||
name="Current Profile",
|
name="Current profile",
|
||||||
icon="mdi:gauge",
|
icon="mdi:gauge",
|
||||||
sensor_type=ValloxProfileSensor,
|
sensor_type=ValloxProfileSensor,
|
||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="fan_speed",
|
key="fan_speed",
|
||||||
name="Fan Speed",
|
name="Fan speed",
|
||||||
metric_key="A_CYC_FAN_SPEED",
|
metric_key="A_CYC_FAN_SPEED",
|
||||||
icon="mdi:fan",
|
icon="mdi:fan",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -144,20 +144,20 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="remaining_time_for_filter",
|
key="remaining_time_for_filter",
|
||||||
name="Remaining Time For Filter",
|
name="Remaining time for filter",
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
sensor_type=ValloxFilterRemainingSensor,
|
sensor_type=ValloxFilterRemainingSensor,
|
||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="cell_state",
|
key="cell_state",
|
||||||
name="Cell State",
|
name="Cell state",
|
||||||
icon="mdi:swap-horizontal-bold",
|
icon="mdi:swap-horizontal-bold",
|
||||||
metric_key="A_CYC_CELL_STATE",
|
metric_key="A_CYC_CELL_STATE",
|
||||||
sensor_type=ValloxCellStateSensor,
|
sensor_type=ValloxCellStateSensor,
|
||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="extract_air",
|
key="extract_air",
|
||||||
name="Extract Air",
|
name="Extract air",
|
||||||
metric_key="A_CYC_TEMP_EXTRACT_AIR",
|
metric_key="A_CYC_TEMP_EXTRACT_AIR",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -165,7 +165,7 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="exhaust_air",
|
key="exhaust_air",
|
||||||
name="Exhaust Air",
|
name="Exhaust air",
|
||||||
metric_key="A_CYC_TEMP_EXHAUST_AIR",
|
metric_key="A_CYC_TEMP_EXHAUST_AIR",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -173,7 +173,7 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="outdoor_air",
|
key="outdoor_air",
|
||||||
name="Outdoor Air",
|
name="Outdoor air",
|
||||||
metric_key="A_CYC_TEMP_OUTDOOR_AIR",
|
metric_key="A_CYC_TEMP_OUTDOOR_AIR",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -181,7 +181,7 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
ValloxSensorEntityDescription(
|
ValloxSensorEntityDescription(
|
||||||
key="supply_air",
|
key="supply_air",
|
||||||
name="Supply Air",
|
name="Supply air",
|
||||||
metric_key="A_CYC_TEMP_SUPPLY_AIR",
|
metric_key="A_CYC_TEMP_SUPPLY_AIR",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user