mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Expose raw PM2.5 in Airgradient (#135457)
This commit is contained in:
parent
4709a3162c
commit
275365a9d3
@ -137,6 +137,15 @@ MEASUREMENT_SENSOR_TYPES: tuple[AirGradientMeasurementSensorEntityDescription, .
|
|||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda status: status.raw_total_volatile_organic_component,
|
value_fn=lambda status: status.raw_total_volatile_organic_component,
|
||||||
),
|
),
|
||||||
|
AirGradientMeasurementSensorEntityDescription(
|
||||||
|
key="pm02_raw",
|
||||||
|
translation_key="raw_pm02",
|
||||||
|
device_class=SensorDeviceClass.PM25,
|
||||||
|
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
value_fn=lambda status: status.raw_pm02,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
CONFIG_SENSOR_TYPES: tuple[AirGradientConfigSensorEntityDescription, ...] = (
|
CONFIG_SENSOR_TYPES: tuple[AirGradientConfigSensorEntityDescription, ...] = (
|
||||||
|
@ -119,6 +119,9 @@
|
|||||||
"raw_nitrogen": {
|
"raw_nitrogen": {
|
||||||
"name": "Raw NOx"
|
"name": "Raw NOx"
|
||||||
},
|
},
|
||||||
|
"raw_pm02": {
|
||||||
|
"name": "Raw PM2.5"
|
||||||
|
},
|
||||||
"display_pm_standard": {
|
"display_pm_standard": {
|
||||||
"name": "[%key:component::airgradient::entity::select::display_pm_standard::name%]",
|
"name": "[%key:component::airgradient::entity::select::display_pm_standard::name%]",
|
||||||
"state": {
|
"state": {
|
||||||
|
@ -763,6 +763,57 @@
|
|||||||
'state': '16931',
|
'state': '16931',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_all_entities[indoor][sensor.airgradient_raw_pm2_5-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.airgradient_raw_pm2_5',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.PM25: 'pm25'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Raw PM2.5',
|
||||||
|
'platform': 'airgradient',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'raw_pm02',
|
||||||
|
'unique_id': '84fce612f5b8-pm02_raw',
|
||||||
|
'unit_of_measurement': 'µg/m³',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_all_entities[indoor][sensor.airgradient_raw_pm2_5-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'pm25',
|
||||||
|
'friendly_name': 'Airgradient Raw PM2.5',
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
'unit_of_measurement': 'µg/m³',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.airgradient_raw_pm2_5',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '34',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_all_entities[indoor][sensor.airgradient_raw_voc-entry]
|
# name: test_all_entities[indoor][sensor.airgradient_raw_voc-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user