From cf612c4bec584f6627eba17e551879e0df67457f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20L=C3=B6vdahl?= Date: Tue, 12 Jul 2022 17:32:37 +0300 Subject: [PATCH] Migrate Vallox to new entity naming style (#75025) --- .../components/vallox/binary_sensor.py | 4 ++-- homeassistant/components/vallox/fan.py | 2 +- homeassistant/components/vallox/sensor.py | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/vallox/binary_sensor.py b/homeassistant/components/vallox/binary_sensor.py index 762b63c0c1d..9f1b3018186 100644 --- a/homeassistant/components/vallox/binary_sensor.py +++ b/homeassistant/components/vallox/binary_sensor.py @@ -21,6 +21,7 @@ class ValloxBinarySensor(ValloxEntity, BinarySensorEntity): entity_description: ValloxBinarySensorEntityDescription _attr_entity_category = EntityCategory.DIAGNOSTIC + _attr_has_entity_name = True def __init__( self, @@ -33,7 +34,6 @@ class ValloxBinarySensor(ValloxEntity, BinarySensorEntity): self.entity_description = description - self._attr_name = f"{name} {description.name}" self._attr_unique_id = f"{self._device_uuid}-{description.key}" @property @@ -59,7 +59,7 @@ class ValloxBinarySensorEntityDescription( SENSORS: tuple[ValloxBinarySensorEntityDescription, ...] = ( ValloxBinarySensorEntityDescription( key="post_heater", - name="Post Heater", + name="Post heater", icon="mdi:radiator", metric_key="A_CYC_IO_HEATER", ), diff --git a/homeassistant/components/vallox/fan.py b/homeassistant/components/vallox/fan.py index 4ba7d2d88fd..be496bbf899 100644 --- a/homeassistant/components/vallox/fan.py +++ b/homeassistant/components/vallox/fan.py @@ -83,6 +83,7 @@ class ValloxFan(ValloxEntity, FanEntity): """Representation of the fan.""" _attr_supported_features = FanEntityFeature.PRESET_MODE + _attr_has_entity_name = True def __init__( self, @@ -95,7 +96,6 @@ class ValloxFan(ValloxEntity, FanEntity): self._client = client - self._attr_name = name self._attr_unique_id = str(self._device_uuid) @property diff --git a/homeassistant/components/vallox/sensor.py b/homeassistant/components/vallox/sensor.py index 54a010c3e3d..48b44dd97fe 100644 --- a/homeassistant/components/vallox/sensor.py +++ b/homeassistant/components/vallox/sensor.py @@ -37,6 +37,7 @@ class ValloxSensor(ValloxEntity, SensorEntity): entity_description: ValloxSensorEntityDescription _attr_entity_category = EntityCategory.DIAGNOSTIC + _attr_has_entity_name = True def __init__( self, @@ -49,7 +50,6 @@ class ValloxSensor(ValloxEntity, SensorEntity): self.entity_description = description - self._attr_name = f"{name} {description.name}" self._attr_unique_id = f"{self._device_uuid}-{description.key}" @property @@ -129,13 +129,13 @@ class ValloxSensorEntityDescription(SensorEntityDescription): SENSORS: tuple[ValloxSensorEntityDescription, ...] = ( ValloxSensorEntityDescription( key="current_profile", - name="Current Profile", + name="Current profile", icon="mdi:gauge", sensor_type=ValloxProfileSensor, ), ValloxSensorEntityDescription( key="fan_speed", - name="Fan Speed", + name="Fan speed", metric_key="A_CYC_FAN_SPEED", icon="mdi:fan", state_class=SensorStateClass.MEASUREMENT, @@ -144,20 +144,20 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = ( ), ValloxSensorEntityDescription( key="remaining_time_for_filter", - name="Remaining Time For Filter", + name="Remaining time for filter", device_class=SensorDeviceClass.TIMESTAMP, sensor_type=ValloxFilterRemainingSensor, ), ValloxSensorEntityDescription( key="cell_state", - name="Cell State", + name="Cell state", icon="mdi:swap-horizontal-bold", metric_key="A_CYC_CELL_STATE", sensor_type=ValloxCellStateSensor, ), ValloxSensorEntityDescription( key="extract_air", - name="Extract Air", + name="Extract air", metric_key="A_CYC_TEMP_EXTRACT_AIR", device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, @@ -165,7 +165,7 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = ( ), ValloxSensorEntityDescription( key="exhaust_air", - name="Exhaust Air", + name="Exhaust air", metric_key="A_CYC_TEMP_EXHAUST_AIR", device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, @@ -173,7 +173,7 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = ( ), ValloxSensorEntityDescription( key="outdoor_air", - name="Outdoor Air", + name="Outdoor air", metric_key="A_CYC_TEMP_OUTDOOR_AIR", device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, @@ -181,7 +181,7 @@ SENSORS: tuple[ValloxSensorEntityDescription, ...] = ( ), ValloxSensorEntityDescription( key="supply_air", - name="Supply Air", + name="Supply air", metric_key="A_CYC_TEMP_SUPPLY_AIR", device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT,