diff --git a/homeassistant/components/airthings_ble/sensor.py b/homeassistant/components/airthings_ble/sensor.py index a8fdc0938f0..b707e8c2a92 100644 --- a/homeassistant/components/airthings_ble/sensor.py +++ b/homeassistant/components/airthings_ble/sensor.py @@ -15,13 +15,11 @@ from homeassistant.components.sensor import ( SensorStateClass, ) from homeassistant.const import ( - CONCENTRATION_PARTS_PER_BILLION, - CONCENTRATION_PARTS_PER_MILLION, LIGHT_LUX, - PERCENTAGE, EntityCategory, Platform, UnitOfPressure, + UnitOfRatio, UnitOfSoundPressure, UnitOfTemperature, ) @@ -102,7 +100,7 @@ SENSORS_MAPPING_TEMPLATE: dict[str, AirthingsBLESensorEntityDescription] = { "humidity": AirthingsBLESensorEntityDescription( key="humidity", device_class=SensorDeviceClass.HUMIDITY, - native_unit_of_measurement=PERCENTAGE, + native_unit_of_measurement=UnitOfRatio.PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=1, ), @@ -116,7 +114,7 @@ SENSORS_MAPPING_TEMPLATE: dict[str, AirthingsBLESensorEntityDescription] = { "battery": AirthingsBLESensorEntityDescription( key="battery", device_class=SensorDeviceClass.BATTERY, - native_unit_of_measurement=PERCENTAGE, + native_unit_of_measurement=UnitOfRatio.PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, suggested_display_precision=0, @@ -124,21 +122,21 @@ SENSORS_MAPPING_TEMPLATE: dict[str, AirthingsBLESensorEntityDescription] = { "co2": AirthingsBLESensorEntityDescription( key="co2", device_class=SensorDeviceClass.CO2, - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + native_unit_of_measurement=UnitOfRatio.PARTS_PER_MILLION, state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=0, ), "voc": AirthingsBLESensorEntityDescription( key="voc", device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS, - native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION, + native_unit_of_measurement=UnitOfRatio.PARTS_PER_BILLION, state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=0, ), "illuminance": AirthingsBLESensorEntityDescription( key="illuminance", translation_key="illuminance", - native_unit_of_measurement=PERCENTAGE, + native_unit_of_measurement=UnitOfRatio.PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=0, ),