mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 07:51:46 -05:00
Report the uHoo volatile organic compounds in the class that carries its unit (#180567)
This commit is contained in:
@@ -99,7 +99,7 @@ SENSOR_TYPES: tuple[UhooSensorEntityDescription, ...] = (
|
||||
UhooSensorEntityDescription(
|
||||
key=API_TVOC,
|
||||
translation_key="volatile_organic_compounds",
|
||||
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
|
||||
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||
native_unit_of_measurement=UnitOfRatio.PARTS_PER_BILLION,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data.tvoc,
|
||||
|
||||
@@ -629,7 +629,7 @@
|
||||
'object_id_base': 'Volatile organic compounds',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS: 'volatile_organic_compounds'>,
|
||||
'original_device_class': <SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS: 'volatile_organic_compounds_parts'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Volatile organic compounds',
|
||||
'platform': 'uhoo',
|
||||
@@ -644,7 +644,7 @@
|
||||
# name: test_sensor_snapshot[sensor.test_device_volatile_organic_compounds-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'volatile_organic_compounds',
|
||||
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'volatile_organic_compounds_parts',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Test Device Volatile organic compounds',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfRatio.PARTS_PER_BILLION: 'ppb'>,
|
||||
|
||||
Reference in New Issue
Block a user