Add number + sensor device class volume storage (#88312)
* Add number + sensor device class volume storage * Fix typo * Format code * Update device automations
This commit is contained in:
@@ -324,6 +324,18 @@ class NumberDeviceClass(StrEnum):
|
||||
USCS/imperial units are currently assumed to be US volumes)
|
||||
"""
|
||||
|
||||
VOLUME_STORAGE = "volume_storage"
|
||||
"""Generic stored volume.
|
||||
|
||||
Use this device class for sensors measuring stored volume, for example the amount
|
||||
of fuel in a fuel tank.
|
||||
|
||||
Unit of measurement: `VOLUME_*` units
|
||||
- SI / metric: `mL`, `L`, `m³`
|
||||
- USCS / imperial: `ft³`, `CCF`, `fl. oz.`, `gal` (warning: volumes expressed in
|
||||
USCS/imperial units are currently assumed to be US volumes)
|
||||
"""
|
||||
|
||||
WATER = "water"
|
||||
"""Water.
|
||||
|
||||
@@ -411,6 +423,7 @@ DEVICE_CLASS_UNITS: dict[NumberDeviceClass, set[type[StrEnum] | str | None]] = {
|
||||
},
|
||||
NumberDeviceClass.VOLTAGE: set(UnitOfElectricPotential),
|
||||
NumberDeviceClass.VOLUME: set(UnitOfVolume),
|
||||
NumberDeviceClass.VOLUME_STORAGE: set(UnitOfVolume),
|
||||
NumberDeviceClass.WATER: {
|
||||
UnitOfVolume.CENTUM_CUBIC_FEET,
|
||||
UnitOfVolume.CUBIC_FEET,
|
||||
|
||||
Reference in New Issue
Block a user