From f8a61d760c3b2500ed334399b2e8cecf4af28965 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 27 Jun 2026 23:49:34 +0200 Subject: [PATCH] Migrate epion to UnitOfDensity / UnitOfRatio enums (#175003) --- homeassistant/components/epion/sensor.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/epion/sensor.py b/homeassistant/components/epion/sensor.py index 80cf47caa4ab..d3a16edf3077 100644 --- a/homeassistant/components/epion/sensor.py +++ b/homeassistant/components/epion/sensor.py @@ -8,12 +8,7 @@ from homeassistant.components.sensor import ( SensorEntityDescription, SensorStateClass, ) -from homeassistant.const import ( - CONCENTRATION_PARTS_PER_MILLION, - PERCENTAGE, - UnitOfPressure, - UnitOfTemperature, -) +from homeassistant.const import UnitOfPressure, UnitOfRatio, UnitOfTemperature from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -26,7 +21,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( device_class=SensorDeviceClass.CO2, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + native_unit_of_measurement=UnitOfRatio.PARTS_PER_MILLION, key="co2", suggested_display_precision=0, ), @@ -40,7 +35,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( device_class=SensorDeviceClass.HUMIDITY, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=PERCENTAGE, + native_unit_of_measurement=UnitOfRatio.PERCENTAGE, key="humidity", suggested_display_precision=1, ),