diff --git a/homeassistant/components/airnow/icons.json b/homeassistant/components/airnow/icons.json new file mode 100644 index 00000000000..0815109b6e9 --- /dev/null +++ b/homeassistant/components/airnow/icons.json @@ -0,0 +1,18 @@ +{ + "entity": { + "sensor": { + "aqi": { + "default": "mdi:blur" + }, + "pm25": { + "default": "mdi:blur" + }, + "o3": { + "default": "mdi:blur" + }, + "station": { + "default": "mdi:blur" + } + } + } +} diff --git a/homeassistant/components/airnow/sensor.py b/homeassistant/components/airnow/sensor.py index 9c154dc0712..bfe9e92c4a3 100644 --- a/homeassistant/components/airnow/sensor.py +++ b/homeassistant/components/airnow/sensor.py @@ -77,7 +77,7 @@ def station_extra_attrs(data: dict[str, Any]) -> dict[str, Any]: SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = ( AirNowEntityDescription( key=ATTR_API_AQI, - icon="mdi:blur", + translation_key="aqi", state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.AQI, value_fn=lambda data: data.get(ATTR_API_AQI), @@ -94,7 +94,7 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = ( ), AirNowEntityDescription( key=ATTR_API_PM25, - icon="mdi:blur", + translation_key="pm25", native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.PM25, @@ -104,7 +104,6 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = ( AirNowEntityDescription( key=ATTR_API_O3, translation_key="o3", - icon="mdi:blur", native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, state_class=SensorStateClass.MEASUREMENT, value_fn=lambda data: data.get(ATTR_API_O3), @@ -113,7 +112,6 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = ( AirNowEntityDescription( key=ATTR_API_STATION, translation_key="station", - icon="mdi:blur", value_fn=lambda data: data.get(ATTR_API_STATION), extra_state_attributes_fn=station_extra_attrs, ),