Flow rate unit conversions and device class (#106077)
* Add volume flow rate conversions
* Add missing translations
* Adjust liter unit and add gallons per minute
* Adjust to min instead of m for minutes
* Add matching class for number
* Add some tests for number and sensor platform
* Add deprecated constants
* Add explicit list of flow rate for check
This reverts commit 105171af31
.
This commit is contained in:
parent
a8e3df7e50
commit
cece117c93
14 changed files with 180 additions and 3 deletions
|
@ -41,6 +41,7 @@ from homeassistant.util.unit_conversion import (
|
|||
TemperatureConverter,
|
||||
UnitlessRatioConverter,
|
||||
VolumeConverter,
|
||||
VolumeFlowRateConverter,
|
||||
)
|
||||
|
||||
from .const import (
|
||||
|
@ -139,6 +140,7 @@ STATISTIC_UNIT_TO_UNIT_CONVERTER: dict[str | None, type[BaseUnitConverter]] = {
|
|||
**{unit: TemperatureConverter for unit in TemperatureConverter.VALID_UNITS},
|
||||
**{unit: UnitlessRatioConverter for unit in UnitlessRatioConverter.VALID_UNITS},
|
||||
**{unit: VolumeConverter for unit in VolumeConverter.VALID_UNITS},
|
||||
**{unit: VolumeFlowRateConverter for unit in VolumeFlowRateConverter.VALID_UNITS},
|
||||
}
|
||||
|
||||
DATA_SHORT_TERM_STATISTICS_RUN_CACHE = "recorder_short_term_statistics_run_cache"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue