Fix unit of measurement for airgradient sensor (#118981)
parent
aa0a90cd98
commit
6027af3d36
|
@ -103,6 +103,7 @@ SENSOR_TYPES: tuple[AirGradientSensorEntityDescription, ...] = (
|
|||
AirGradientSensorEntityDescription(
|
||||
key="pm003",
|
||||
translation_key="pm003_count",
|
||||
native_unit_of_measurement="particles/dL",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda status: status.pm003_count,
|
||||
),
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"name": "Nitrogen index"
|
||||
},
|
||||
"pm003_count": {
|
||||
"name": "PM0.3 count"
|
||||
"name": "PM0.3"
|
||||
},
|
||||
"raw_total_volatile_organic_component": {
|
||||
"name": "Raw total VOC"
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
'state': '1',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensor.airgradient_pm0_3_count-entry]
|
||||
# name: test_all_entities[sensor.airgradient_pm0_3-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
|
@ -164,7 +164,7 @@
|
|||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.airgradient_pm0_3_count',
|
||||
'entity_id': 'sensor.airgradient_pm0_3',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
|
@ -176,23 +176,24 @@
|
|||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'PM0.3 count',
|
||||
'original_name': 'PM0.3',
|
||||
'platform': 'airgradient',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'pm003_count',
|
||||
'unique_id': '84fce612f5b8-pm003',
|
||||
'unit_of_measurement': None,
|
||||
'unit_of_measurement': 'particles/dL',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[sensor.airgradient_pm0_3_count-state]
|
||||
# name: test_all_entities[sensor.airgradient_pm0_3-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Airgradient PM0.3 count',
|
||||
'friendly_name': 'Airgradient PM0.3',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'particles/dL',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.airgradient_pm0_3_count',
|
||||
'entity_id': 'sensor.airgradient_pm0_3',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
|
|
Loading…
Reference in New Issue