From 24ce1cc654d07a9be23d25eab110ff2a4a752abe Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 29 Aug 2026 01:24:14 +0200 Subject: [PATCH] Report the uHoo volatile organic compounds in the class that carries its unit (#180567) --- homeassistant/components/uhoo/sensor.py | 2 +- tests/components/uhoo/snapshots/test_sensor.ambr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/uhoo/sensor.py b/homeassistant/components/uhoo/sensor.py index ed9b8298667b..0044d97ec1cd 100644 --- a/homeassistant/components/uhoo/sensor.py +++ b/homeassistant/components/uhoo/sensor.py @@ -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, diff --git a/tests/components/uhoo/snapshots/test_sensor.ambr b/tests/components/uhoo/snapshots/test_sensor.ambr index b8c8624aeb65..8900f3a0516f 100644 --- a/tests/components/uhoo/snapshots/test_sensor.ambr +++ b/tests/components/uhoo/snapshots/test_sensor.ambr @@ -629,7 +629,7 @@ 'object_id_base': 'Volatile organic compounds', 'options': dict({ }), - 'original_device_class': , + 'original_device_class': , '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({ - : 'volatile_organic_compounds', + : 'volatile_organic_compounds_parts', : 'Test Device Volatile organic compounds', : , : ,