diff --git a/homeassistant/components/bthome/sensor.py b/homeassistant/components/bthome/sensor.py index b58eb514020..219ce17c081 100644 --- a/homeassistant/components/bthome/sensor.py +++ b/homeassistant/components/bthome/sensor.py @@ -25,7 +25,6 @@ from homeassistant.const import ( LIGHT_LUX, PERCENTAGE, SIGNAL_STRENGTH_DECIBELS_MILLIWATT, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, UnitOfElectricCurrent, UnitOfElectricPotential, UnitOfEnergy, @@ -37,6 +36,7 @@ from homeassistant.const import ( UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import EntityCategory @@ -280,7 +280,7 @@ SENSOR_DESCRIPTIONS = { Units.VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, ): SensorEntityDescription( key=f"{BTHomeSensorDeviceClass.VOLUME_FLOW_RATE}_{Units.VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR}", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, state_class=SensorStateClass.MEASUREMENT, ), } diff --git a/homeassistant/components/comfoconnect/sensor.py b/homeassistant/components/comfoconnect/sensor.py index cb5ed561e6e..21e6eda255d 100644 --- a/homeassistant/components/comfoconnect/sensor.py +++ b/homeassistant/components/comfoconnect/sensor.py @@ -40,11 +40,11 @@ from homeassistant.const import ( CONF_RESOURCES, PERCENTAGE, REVOLUTIONS_PER_MINUTE, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, UnitOfEnergy, UnitOfPower, UnitOfTemperature, UnitOfTime, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validation as cv @@ -209,7 +209,7 @@ SENSOR_TYPES = ( key=ATTR_AIR_FLOW_SUPPLY, state_class=SensorStateClass.MEASUREMENT, name="Supply airflow", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, icon="mdi:fan-plus", sensor_id=SENSOR_FAN_SUPPLY_FLOW, ), @@ -217,7 +217,7 @@ SENSOR_TYPES = ( key=ATTR_AIR_FLOW_EXHAUST, state_class=SensorStateClass.MEASUREMENT, name="Exhaust airflow", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, icon="mdi:fan-minus", sensor_id=SENSOR_FAN_EXHAUST_FLOW, ), diff --git a/homeassistant/components/isy994/const.py b/homeassistant/components/isy994/const.py index 165162c6bb4..8f6c9b0f888 100644 --- a/homeassistant/components/isy994/const.py +++ b/homeassistant/components/isy994/const.py @@ -33,8 +33,6 @@ from homeassistant.const import ( STATE_UNKNOWN, STATE_UNLOCKED, UV_INDEX, - VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, Platform, UnitOfElectricCurrent, UnitOfElectricPotential, @@ -50,6 +48,7 @@ from homeassistant.const import ( UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, UnitOfVolumetricFlux, ) @@ -298,7 +297,7 @@ UOM_FRIENDLY_NAME = { "4": UnitOfTemperature.CELSIUS, "5": UnitOfLength.CENTIMETERS, "6": UnitOfVolume.CUBIC_FEET, - "7": VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE, + "7": UnitOfVolumeFlowRate.CUBIC_FEET_PER_MINUTE, "8": UnitOfVolume.CUBIC_METERS, "9": UnitOfTime.DAYS, "10": UnitOfTime.DAYS, @@ -328,7 +327,7 @@ UOM_FRIENDLY_NAME = { "36": LIGHT_LUX, "37": "mercalli", "38": UnitOfLength.METERS, - "39": VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + "39": UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, "40": UnitOfSpeed.METERS_PER_SECOND, "41": UnitOfElectricCurrent.MILLIAMPERE, "42": UnitOfTime.MILLISECONDS, diff --git a/homeassistant/components/landisgyr_heat_meter/const.py b/homeassistant/components/landisgyr_heat_meter/const.py index c17a119a6c3..aae62f926d8 100644 --- a/homeassistant/components/landisgyr_heat_meter/const.py +++ b/homeassistant/components/landisgyr_heat_meter/const.py @@ -6,12 +6,12 @@ from homeassistant.components.sensor import ( SensorStateClass, ) from homeassistant.const import ( - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, UnitOfEnergy, UnitOfPower, UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, ) from homeassistant.helpers.entity import EntityCategory @@ -111,14 +111,14 @@ HEAT_METER_SENSOR_TYPES = ( SensorEntityDescription( key="flowrate_max_m3ph", name="Flowrate max", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, icon="mdi:water-outline", entity_category=EntityCategory.DIAGNOSTIC, ), SensorEntityDescription( key="flowrate_max_previous_year_m3ph", name="Flowrate max previous year", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, icon="mdi:water-outline", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -200,7 +200,7 @@ HEAT_METER_SENSOR_TYPES = ( SensorEntityDescription( key="measuring_range_m3ph", name="Measuring range", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, icon="mdi:water-outline", entity_category=EntityCategory.DIAGNOSTIC, ), diff --git a/homeassistant/components/matter/sensor.py b/homeassistant/components/matter/sensor.py index e031e0d8c85..38a701e779a 100644 --- a/homeassistant/components/matter/sensor.py +++ b/homeassistant/components/matter/sensor.py @@ -21,10 +21,10 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( LIGHT_LUX, PERCENTAGE, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, Platform, UnitOfPressure, UnitOfTemperature, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -139,7 +139,7 @@ DEVICE_ENTITY: dict[ name="Flow", measurement_to_ha=lambda x: x / 10, subscribe_attributes=(clusters.FlowMeasurement.Attributes.MeasuredValue,), - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, ), device_types.HumiditySensor: MatterSensorEntityDescriptionFactory( key=device_types.HumiditySensor, diff --git a/homeassistant/components/overkiz/sensor.py b/homeassistant/components/overkiz/sensor.py index 727e0886403..e6a0e04deb7 100644 --- a/homeassistant/components/overkiz/sensor.py +++ b/homeassistant/components/overkiz/sensor.py @@ -20,12 +20,12 @@ from homeassistant.const import ( LIGHT_LUX, PERCENTAGE, SIGNAL_STRENGTH_DECIBELS, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, UnitOfEnergy, UnitOfPower, UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo, EntityCategory @@ -116,7 +116,7 @@ SENSOR_DESCRIPTIONS: list[OverkizSensorDescription] = [ key=OverkizState.IO_INLET_ENGINE, name="Inlet engine", icon="mdi:fan-chevron-up", - native_unit_of_measurement=VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, + native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, state_class=SensorStateClass.MEASUREMENT, ), OverkizSensorDescription( diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index ea996f7760d..9fd8892b977 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -20,8 +20,6 @@ from homeassistant.const import ( CONCENTRATION_PARTS_PER_MILLION, LIGHT_LUX, PERCENTAGE, - VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, Platform, UnitOfApparentPower, UnitOfElectricCurrent, @@ -34,6 +32,7 @@ from homeassistant.const import ( UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect @@ -423,9 +422,9 @@ class SmartEnergyMetering(Sensor): unit_of_measure_map = { 0x00: UnitOfPower.WATT, - 0x01: VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, - 0x02: VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE, - 0x03: f"100 {VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR}", + 0x01: UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR, + 0x02: UnitOfVolumeFlowRate.CUBIC_FEET_PER_MINUTE, + 0x03: f"100 {UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR}", 0x04: f"US {UnitOfVolume.GALLONS}/{UnitOfTime.HOURS}", 0x05: f"IMP {UnitOfVolume.GALLONS}/{UnitOfTime.HOURS}", 0x06: UnitOfPower.BTU_PER_HOUR, diff --git a/homeassistant/components/zwave_js/discovery_data_template.py b/homeassistant/components/zwave_js/discovery_data_template.py index af8a627d312..5f43d802e30 100644 --- a/homeassistant/components/zwave_js/discovery_data_template.py +++ b/homeassistant/components/zwave_js/discovery_data_template.py @@ -96,8 +96,6 @@ from homeassistant.const import ( PERCENTAGE, SIGNAL_STRENGTH_DECIBELS, SIGNAL_STRENGTH_DECIBELS_MILLIWATT, - VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, UnitOfElectricCurrent, UnitOfElectricPotential, UnitOfEnergy, @@ -111,6 +109,7 @@ from homeassistant.const import ( UnitOfTemperature, UnitOfTime, UnitOfVolume, + UnitOfVolumeFlowRate, UnitOfVolumetricFlux, ) @@ -172,9 +171,9 @@ MULTILEVEL_SENSOR_UNIT_MAP: dict[str, set[MultilevelSensorScaleType]] = { UnitOfPower.BTU_PER_HOUR: UNIT_BTU_H, UnitOfTemperature.CELSIUS: UNIT_CELSIUS, UnitOfLength.CENTIMETERS: UNIT_CENTIMETER, - VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE: UNIT_CUBIC_FEET_PER_MINUTE, + UnitOfVolumeFlowRate.CUBIC_FEET_PER_MINUTE: UNIT_CUBIC_FEET_PER_MINUTE, UnitOfVolume.CUBIC_METERS: SENSOR_UNIT_CUBIC_METER, - VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR: UNIT_CUBIC_METER_PER_HOUR, + UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR: UNIT_CUBIC_METER_PER_HOUR, SIGNAL_STRENGTH_DECIBELS: UNIT_DECIBEL, DEGREE: UNIT_DEGREES, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER: {