1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Use device_class for O3 in Google Air Quality (#161380)

This commit is contained in:
Thomas55555
2026-01-21 17:34:46 +01:00
committed by GitHub
parent 987396722b
commit 493319894b
4 changed files with 4 additions and 9 deletions

View File

@@ -12,9 +12,6 @@
},
"non_methane_hydrocarbons": {
"default": "mdi:molecule"
},
"ozone": {
"default": "mdi:molecule"
}
}
}

View File

@@ -154,8 +154,8 @@ AIR_QUALITY_SENSOR_TYPES: tuple[AirQualitySensorEntityDescription, ...] = (
),
AirQualitySensorEntityDescription(
key="o3",
translation_key="ozone",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.OZONE,
native_unit_of_measurement_fn=lambda x: x.pollutants.o3.concentration.units,
exists_fn=lambda x: "o3" in {p.code for p in x.pollutants},
value_fn=lambda x: x.pollutants.o3.concentration.value,

View File

@@ -211,9 +211,6 @@
"non_methane_hydrocarbons": {
"name": "Non-methane hydrocarbons"
},
"ozone": {
"name": "[%key:component::sensor::entity_component::ozone::name%]"
},
"uaqi": {
"name": "Universal Air Quality Index"
},

View File

@@ -484,14 +484,14 @@
'object_id_base': 'Ozone',
'options': dict({
}),
'original_device_class': None,
'original_device_class': <SensorDeviceClass.OZONE: 'ozone'>,
'original_icon': None,
'original_name': 'Ozone',
'platform': 'google_air_quality',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'ozone',
'translation_key': None,
'unique_id': 'o3_10.1_20.1',
'unit_of_measurement': 'ppb',
})
@@ -500,6 +500,7 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'attribution': 'Data provided by Google Air Quality',
'device_class': 'ozone',
'friendly_name': 'Home Ozone',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'ppb',