mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Allow mL/s as UnitOfVolumeFlowRate (#130771)
This commit is contained in:
parent
797eb606fe
commit
3cfd958dc2
@ -404,7 +404,7 @@ class NumberDeviceClass(StrEnum):
|
||||
"""Generic flow rate
|
||||
|
||||
Unit of measurement: UnitOfVolumeFlowRate
|
||||
- SI / metric: `m³/h`, `L/min`
|
||||
- SI / metric: `m³/h`, `L/min`, `mL/s`
|
||||
- USCS / imperial: `ft³/min`, `gal/min`
|
||||
"""
|
||||
|
||||
|
@ -427,7 +427,7 @@ class SensorDeviceClass(StrEnum):
|
||||
"""Generic flow rate
|
||||
|
||||
Unit of measurement: UnitOfVolumeFlowRate
|
||||
- SI / metric: `m³/h`, `L/min`
|
||||
- SI / metric: `m³/h`, `L/min`, `mL/s`
|
||||
- USCS / imperial: `ft³/min`, `gal/min`
|
||||
"""
|
||||
|
||||
|
@ -1166,6 +1166,7 @@ class UnitOfVolumeFlowRate(StrEnum):
|
||||
CUBIC_FEET_PER_MINUTE = "ft³/min"
|
||||
LITERS_PER_MINUTE = "L/min"
|
||||
GALLONS_PER_MINUTE = "gal/min"
|
||||
MILLILITERS_PER_SECOND = "mL/s"
|
||||
|
||||
|
||||
_DEPRECATED_VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR: Final = DeprecatedConstantEnum(
|
||||
|
@ -666,12 +666,15 @@ class VolumeFlowRateConverter(BaseUnitConverter):
|
||||
/ (_HRS_TO_MINUTES * _L_TO_CUBIC_METER),
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE: 1
|
||||
/ (_HRS_TO_MINUTES * _GALLON_TO_CUBIC_METER),
|
||||
UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND: 1
|
||||
/ (_HRS_TO_SECS * _ML_TO_CUBIC_METER),
|
||||
}
|
||||
VALID_UNITS = {
|
||||
UnitOfVolumeFlowRate.CUBIC_FEET_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND,
|
||||
}
|
||||
|
||||
|
||||
|
@ -743,6 +743,18 @@ _CONVERTED_VALUE: dict[
|
||||
7.48051948,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
),
|
||||
(
|
||||
9,
|
||||
UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
|
||||
2500,
|
||||
UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND,
|
||||
),
|
||||
(
|
||||
3,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
50,
|
||||
UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND,
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user