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:
parent
29b049fc57
commit
fca5cc6ea3
6 changed files with 33 additions and 0 deletions
|
@ -362,6 +362,18 @@ class SensorDeviceClass(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.
|
||||
|
||||
|
@ -451,6 +463,7 @@ UNIT_CONVERTERS: dict[SensorDeviceClass | str | None, type[BaseUnitConverter]] =
|
|||
SensorDeviceClass.TEMPERATURE: TemperatureConverter,
|
||||
SensorDeviceClass.VOLTAGE: ElectricPotentialConverter,
|
||||
SensorDeviceClass.VOLUME: VolumeConverter,
|
||||
SensorDeviceClass.VOLUME_STORAGE: VolumeConverter,
|
||||
SensorDeviceClass.WATER: VolumeConverter,
|
||||
SensorDeviceClass.WEIGHT: MassConverter,
|
||||
SensorDeviceClass.WIND_SPEED: SpeedConverter,
|
||||
|
@ -573,6 +586,7 @@ DEVICE_CLASS_STATE_CLASSES: dict[SensorDeviceClass, set[SensorStateClass]] = {
|
|||
SensorStateClass.TOTAL,
|
||||
SensorStateClass.TOTAL_INCREASING,
|
||||
},
|
||||
SensorDeviceClass.VOLUME_STORAGE: {SensorStateClass.MEASUREMENT},
|
||||
SensorDeviceClass.WATER: {
|
||||
SensorStateClass.TOTAL,
|
||||
SensorStateClass.TOTAL_INCREASING,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue