mirror of
https://github.com/home-assistant/core.git
synced 2026-02-15 07:36:16 +00:00
Add gallons per hour as volume flow rate unit (#154246)
Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>
This commit is contained in:
@@ -665,6 +665,7 @@ class UnitOfVolumeFlowRate(StrEnum):
|
||||
LITERS_PER_HOUR = "L/h"
|
||||
LITERS_PER_MINUTE = "L/min"
|
||||
LITERS_PER_SECOND = "L/s"
|
||||
GALLONS_PER_HOUR = "gal/h"
|
||||
GALLONS_PER_MINUTE = "gal/min"
|
||||
MILLILITERS_PER_SECOND = "mL/s"
|
||||
|
||||
|
||||
@@ -826,6 +826,7 @@ class VolumeFlowRateConverter(BaseUnitConverter):
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE: 1
|
||||
/ (_HRS_TO_MINUTES * _L_TO_CUBIC_METER),
|
||||
UnitOfVolumeFlowRate.LITERS_PER_SECOND: 1 / (_HRS_TO_SECS * _L_TO_CUBIC_METER),
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_HOUR: 1 / _GALLON_TO_CUBIC_METER,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE: 1
|
||||
/ (_HRS_TO_MINUTES * _GALLON_TO_CUBIC_METER),
|
||||
UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND: 1
|
||||
@@ -839,6 +840,7 @@ class VolumeFlowRateConverter(BaseUnitConverter):
|
||||
UnitOfVolumeFlowRate.LITERS_PER_HOUR,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_SECOND,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_HOUR,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND,
|
||||
}
|
||||
|
||||
@@ -977,6 +977,12 @@ _CONVERTED_VALUE: dict[
|
||||
7.48051948,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
),
|
||||
(
|
||||
1,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_HOUR,
|
||||
0.264172052,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_HOUR,
|
||||
),
|
||||
(
|
||||
9,
|
||||
UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
|
||||
|
||||
Reference in New Issue
Block a user