diff --git a/homeassistant/components/qbus/sensor.py b/homeassistant/components/qbus/sensor.py index a6ac05c45d95..70953eff5225 100644 --- a/homeassistant/components/qbus/sensor.py +++ b/homeassistant/components/qbus/sensor.py @@ -22,15 +22,14 @@ from homeassistant.components.sensor import ( SensorStateClass, ) from homeassistant.const import ( - CONCENTRATION_PARTS_PER_MILLION, LIGHT_LUX, - PERCENTAGE, UnitOfElectricCurrent, UnitOfElectricPotential, UnitOfEnergy, UnitOfLength, UnitOfPower, UnitOfPressure, + UnitOfRatio, UnitOfSoundPressure, UnitOfSpeed, UnitOfTemperature, @@ -126,7 +125,7 @@ _GAUGE_VARIANT_DESCRIPTIONS = { "AIRQUALITY": SensorEntityDescription( key="airquality", device_class=SensorDeviceClass.CO2, - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + native_unit_of_measurement=UnitOfRatio.PARTS_PER_MILLION, state_class=SensorStateClass.MEASUREMENT, ), "CURRENT": SensorEntityDescription( @@ -156,7 +155,7 @@ _GAUGE_VARIANT_DESCRIPTIONS = { "HUMIDITY": SensorEntityDescription( key="humidity", device_class=SensorDeviceClass.HUMIDITY, - native_unit_of_measurement=PERCENTAGE, + native_unit_of_measurement=UnitOfRatio.PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, ), "LIGHT": SensorEntityDescription( @@ -353,7 +352,7 @@ class QbusHumiditySensor(QbusEntity, SensorEntity): _attr_device_class = SensorDeviceClass.HUMIDITY _attr_name = None - _attr_native_unit_of_measurement = PERCENTAGE + _attr_native_unit_of_measurement = UnitOfRatio.PERCENTAGE _attr_state_class = SensorStateClass.MEASUREMENT @override @@ -382,7 +381,7 @@ class QbusVentilationSensor(QbusEntity, SensorEntity): _attr_device_class = SensorDeviceClass.CO2 _attr_name = None - _attr_native_unit_of_measurement = CONCENTRATION_PARTS_PER_MILLION + _attr_native_unit_of_measurement = UnitOfRatio.PARTS_PER_MILLION _attr_state_class = SensorStateClass.MEASUREMENT _attr_suggested_display_precision = 0 diff --git a/tests/components/qbus/snapshots/test_sensor.ambr b/tests/components/qbus/snapshots/test_sensor.ambr index 2a92f6af6020..d2623f88e34f 100644 --- a/tests/components/qbus/snapshots/test_sensor.ambr +++ b/tests/components/qbus/snapshots/test_sensor.ambr @@ -267,7 +267,7 @@ 'supported_features': 0, 'translation_key': None, 'unique_id': 'ctd_000001_94-1', - 'unit_of_measurement': '%', + 'unit_of_measurement': , }) # --- # name: test_sensor[sensor.kitchen_vochtigheid_keuken-state] @@ -276,7 +276,7 @@ : 'humidity', : 'Vochtigheid Keuken', : , - : '%', + : , }), 'context': , 'entity_id': 'sensor.kitchen_vochtigheid_keuken', @@ -441,7 +441,7 @@ 'supported_features': 0, 'translation_key': None, 'unique_id': 'ctd_000001_224', - 'unit_of_measurement': 'ppm', + 'unit_of_measurement': , }) # --- # name: test_sensor[sensor.luchtsensor-state] @@ -450,7 +450,7 @@ : 'carbon_dioxide', : 'Luchtsensor', : , - : 'ppm', + : , }), 'context': , 'entity_id': 'sensor.luchtsensor', @@ -615,7 +615,7 @@ 'supported_features': 0, 'translation_key': None, 'unique_id': 'ctd_000001_82', - 'unit_of_measurement': 'ppm', + 'unit_of_measurement': , }) # --- # name: test_sensor[sensor.tuin_luchtkwaliteit-state] @@ -624,7 +624,7 @@ : 'carbon_dioxide', : 'Luchtkwaliteit', : , - : 'ppm', + : , }), 'context': , 'entity_id': 'sensor.tuin_luchtkwaliteit',