mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Use UnitOfVolume in energy integration (#83641)
This commit is contained in:
parent
e15388a2a0
commit
b63359b186
@ -16,15 +16,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.components.sensor.recorder import reset_detected
|
from homeassistant.components.sensor.recorder import reset_detected
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, UnitOfEnergy, UnitOfVolume
|
||||||
ATTR_UNIT_OF_MEASUREMENT,
|
|
||||||
VOLUME_CUBIC_FEET,
|
|
||||||
VOLUME_CUBIC_METERS,
|
|
||||||
VOLUME_GALLONS,
|
|
||||||
VOLUME_LITERS,
|
|
||||||
UnitOfEnergy,
|
|
||||||
UnitOfVolume,
|
|
||||||
)
|
|
||||||
from homeassistant.core import (
|
from homeassistant.core import (
|
||||||
HomeAssistant,
|
HomeAssistant,
|
||||||
State,
|
State,
|
||||||
@ -55,15 +47,15 @@ VALID_ENERGY_UNITS: set[str] = {
|
|||||||
UnitOfEnergy.GIGA_JOULE,
|
UnitOfEnergy.GIGA_JOULE,
|
||||||
}
|
}
|
||||||
VALID_ENERGY_UNITS_GAS = {
|
VALID_ENERGY_UNITS_GAS = {
|
||||||
VOLUME_CUBIC_FEET,
|
UnitOfVolume.CUBIC_FEET,
|
||||||
VOLUME_CUBIC_METERS,
|
UnitOfVolume.CUBIC_METERS,
|
||||||
*VALID_ENERGY_UNITS,
|
*VALID_ENERGY_UNITS,
|
||||||
}
|
}
|
||||||
VALID_VOLUME_UNITS_WATER = {
|
VALID_VOLUME_UNITS_WATER: set[str] = {
|
||||||
VOLUME_CUBIC_FEET,
|
UnitOfVolume.CUBIC_FEET,
|
||||||
VOLUME_CUBIC_METERS,
|
UnitOfVolume.CUBIC_METERS,
|
||||||
VOLUME_GALLONS,
|
UnitOfVolume.GALLONS,
|
||||||
VOLUME_LITERS,
|
UnitOfVolume.LITERS,
|
||||||
}
|
}
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user