diff --git a/homeassistant/components/airvisual/sensor.py b/homeassistant/components/airvisual/sensor.py index 52d046cef42..e28a11666da 100644 --- a/homeassistant/components/airvisual/sensor.py +++ b/homeassistant/components/airvisual/sensor.py @@ -62,20 +62,20 @@ SENSOR_KIND_VOC = "voc" GEOGRAPHY_SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=SENSOR_KIND_LEVEL, - name="Air Pollution Level", + name="Air pollution level", device_class=DEVICE_CLASS_POLLUTANT_LEVEL, icon="mdi:gauge", ), SensorEntityDescription( key=SENSOR_KIND_AQI, - name="Air Quality Index", + name="Air quality index", device_class=SensorDeviceClass.AQI, native_unit_of_measurement="AQI", state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=SENSOR_KIND_POLLUTANT, - name="Main Pollutant", + name="Main pollutant", device_class=DEVICE_CLASS_POLLUTANT_LABEL, icon="mdi:chemical-weapon", ), @@ -85,7 +85,7 @@ GEOGRAPHY_SENSOR_LOCALES = {"cn": "Chinese", "us": "U.S."} NODE_PRO_SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=SENSOR_KIND_AQI, - name="Air Quality Index", + name="Air quality index", device_class=SensorDeviceClass.AQI, native_unit_of_measurement="AQI", state_class=SensorStateClass.MEASUREMENT, @@ -292,6 +292,8 @@ class AirVisualGeographySensor(AirVisualEntity, SensorEntity): class AirVisualNodeProSensor(AirVisualEntity, SensorEntity): """Define an AirVisual sensor related to a Node/Pro unit.""" + _attr_has_entity_name = True + def __init__( self, coordinator: DataUpdateCoordinator, @@ -301,9 +303,6 @@ class AirVisualNodeProSensor(AirVisualEntity, SensorEntity): """Initialize.""" super().__init__(coordinator, entry, description) - self._attr_name = ( - f"{coordinator.data['settings']['node_name']} Node/Pro: {description.name}" - ) self._attr_unique_id = f"{coordinator.data['serial_number']}_{description.key}" @property