Repository: home-assistant/core
File: homeassistant/components/google_air_quality/sensor.py (Python)

Code before:
        translation_key="local_dominant_pollutant",
        device_class=SensorDeviceClass.ENUM,
        value_fn=lambda x: x.indexes[1].dominant_pollutant,
        options_fn=lambda x: x.indexes[1].pollutant_options,
        translation_placeholders_fn=lambda data: {
            "local_aqi": data.indexes[1].display_name
        },
    ),
    AirQualitySensorEntityDescription(
        key="co",
        state_class=SensorStateClass.MEASUREMENT,
        device_class=SensorDeviceClass.CO,
        native_unit_of_measurement_fn=lambda x: x.pollutants.co.concentration.units,
        value_fn=lambda x: x.pollutants.co.concentration.value,
    ),
    AirQualitySensorEntityDescription(
        key="no2",
        translation_key="nitrogen_dioxide",
        state_class=SensorStateClass.MEASUREMENT,
        native_unit_of_measurement_fn=lambda x: x.pollutants.no2.concentration.units,
        value_fn=lambda x: x.pollutants.no2.concentration.value,
    ),
    AirQualitySensorEntityDescription(
        key="o3",
        state_class=SensorStateClass.MEASUREMENT,
        device_class=SensorDeviceClass.OZONE,
        native_unit_of_measurement_fn=lambda x: x.pollutants.o3.concentration.units,
        value_fn=lambda x: x.pollutants.o3.concentration.value,
    ),
    AirQualitySensorEntityDescription(
        key="pm10",
        state_class=SensorStateClass.MEASUREMENT,
        device_class=SensorDeviceClass.PM10,
        native_unit_of_measurement_fn=lambda x: x.pollutants.pm10.concentration.units,
        value_fn=lambda x: x.pollutants.pm10.concentration.value,
    ),
    AirQualitySensorEntityDescription(
        key="pm25",
        state_class=SensorStateClass.MEASUREMENT,
        device_class=SensorDeviceClass.PM25,
        native_unit_of_measurement_fn=lambda x: x.pollutants.pm25.concentration.units,
        value_fn=lambda x: x.pollutants.pm25.concentration.value,
    ),
    AirQualitySensorEntityDescription(
        key="so2",
        translation_key="sulphur_dioxide",
        state_class=SensorStateClass.MEASUREMENT,
        native_unit_of_measurement_fn=lambda x: x.pollutants.so2.concentration.units,
        value_fn=lambda x: x.pollutants.so2.concentration.value,
    ),
)

Review comment (suggestion):
The policy is to update the integrations separately from the core `number`/`recorder`/`sensor`/`util` amends.

I suggest to remove the amends to `google_air_quality` until the device class amends are merged.

Code after:
        translation_key="local_dominant_pollutant",
        device_class=SensorDeviceClass.ENUM,
        value_fn=lambda x: x.indexes[1].dominant_pollutant,
        options_fn=lambda x: x.indexes[1].pollutant_options,
        translation_placeholders_fn=lambda data: {
            "local_aqi": data.indexes[1].display_name
        },
    ),
    AirQualitySensorEntityDescription(
        key="c6h6",
        translation_key="benzene",
        state_class=SensorStateClass.MEASUREMENT,
        native_unit_of_measurement_fn=lambda x: x.pollutants.c6h6.concentration.units,
        value_fn=lambda x: x.pollutants.c6h6.concentration.value,
        exists_fn=lambda x: "c6h6" in {p.code for p in x.pollutants},
    ),
    AirQualitySensorEntityDescription(
        key="co",
        state_class=SensorStateClass.MEASUREMENT,
        device_class=SensorDeviceClass.CO,
        native_unit_of_measurement_fn=lambda x: x.pollutants.co.concentration.units,
        exists_fn=lambda x: "co" in {p.code for p in x.pollutants},
        value_fn=lambda x: x.pollutants.co.concentration.value,
    ),
    AirQualitySensorEntityDescription(
        key="nh3",
        translation_key="ammonia",
        state_class=SensorStateClass.MEASUREMENT,
        native_unit_of_measurement_fn=lambda x: x.pollutants.nh3.concentration.units,
        value_fn=lambda x: x.pollutants.nh3.concentration.value,
        exists_fn=lambda x: "nh3" in {p.code for p in x.pollutants},
    ),
    AirQualitySensorEntityDescription(
        key="nmhc",
        translation_key="non_methane_hydrocarbons",
        state_class=SensorStateClass.MEASUREMENT,
        native_unit_of_measurement_fn=lambda x: x.pollutants.nmhc.concentration.units,
        value_fn=lambda x: x.pollutants.nmhc.concentration.value,
        exists_fn=lambda x: "nmhc" in {p.code for p in x.pollutants},
    ),
    AirQualitySensorEntityDescription(
        key="no",
        translation_key="nitrogen_monoxide",
        state_class=SensorStateClass.MEASUREMENT,
        native_unit_of_measurement_fn=lambda x: x.pollutants.no.concentration.units,
        value_fn=lambda x: x.pollutants.no.concentration.value,
        exists_fn=lambda x: "no" in {p.code for p in x.pollutants},
    ),
    AirQualitySensorEntityDescription(
        key="no2",
        translation_key="nitrogen_dioxide",