Add volume to SensorDeviceClass (#77960)
* Add volume to SensorDeviceClass * Adjust recorder * Adjust tests * Adjust sensor UNIT_CONVERTERS * Adjust recorder * Update strings.json
This commit is contained in:
parent
d8a15f3dda
commit
12e4d18038
10 changed files with 113 additions and 23 deletions
|
@ -23,6 +23,10 @@ from homeassistant.const import (
|
|||
STATE_UNKNOWN,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
VOLUME_CUBIC_FEET,
|
||||
VOLUME_CUBIC_METERS,
|
||||
VOLUME_FLUID_OUNCE,
|
||||
VOLUME_LITERS,
|
||||
)
|
||||
from homeassistant.core import State
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
@ -549,6 +553,31 @@ async def test_custom_unit(
|
|||
100,
|
||||
SensorDeviceClass.SPEED,
|
||||
),
|
||||
# Volume
|
||||
(
|
||||
VOLUME_CUBIC_METERS,
|
||||
VOLUME_CUBIC_FEET,
|
||||
VOLUME_CUBIC_FEET,
|
||||
100,
|
||||
3531,
|
||||
SensorDeviceClass.VOLUME,
|
||||
),
|
||||
(
|
||||
VOLUME_FLUID_OUNCE,
|
||||
VOLUME_LITERS,
|
||||
VOLUME_LITERS,
|
||||
78,
|
||||
2.3,
|
||||
SensorDeviceClass.VOLUME,
|
||||
),
|
||||
(
|
||||
VOLUME_CUBIC_METERS,
|
||||
"peer_distance",
|
||||
VOLUME_CUBIC_METERS,
|
||||
100,
|
||||
100,
|
||||
SensorDeviceClass.VOLUME,
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_custom_unit_change(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue