Report the uHoo volatile organic compounds in the class that carries its unit (#180567)

This commit is contained in:
Franck Nijhof
2026-08-29 08:32:14 +00:00
parent 70996e8379
commit 24ce1cc654
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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'>,