mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Update sensor test (#85522)
This commit is contained in:
parent
1cdd535f21
commit
72c9ca2567
@ -32,6 +32,7 @@ from homeassistant.const import (
|
|||||||
VOLUME_CUBIC_METERS,
|
VOLUME_CUBIC_METERS,
|
||||||
VOLUME_FLUID_OUNCE,
|
VOLUME_FLUID_OUNCE,
|
||||||
VOLUME_LITERS,
|
VOLUME_LITERS,
|
||||||
|
UnitOfEnergy,
|
||||||
UnitOfTemperature,
|
UnitOfTemperature,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, State
|
from homeassistant.core import HomeAssistant, State
|
||||||
@ -500,6 +501,32 @@ async def test_custom_unit(
|
|||||||
1000,
|
1000,
|
||||||
SensorDeviceClass.DISTANCE,
|
SensorDeviceClass.DISTANCE,
|
||||||
),
|
),
|
||||||
|
# Energy
|
||||||
|
(
|
||||||
|
UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
|
UnitOfEnergy.MEGA_WATT_HOUR,
|
||||||
|
UnitOfEnergy.MEGA_WATT_HOUR,
|
||||||
|
1000,
|
||||||
|
1.0,
|
||||||
|
SensorDeviceClass.ENERGY,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
UnitOfEnergy.GIGA_JOULE,
|
||||||
|
UnitOfEnergy.MEGA_WATT_HOUR,
|
||||||
|
UnitOfEnergy.MEGA_WATT_HOUR,
|
||||||
|
1000,
|
||||||
|
278,
|
||||||
|
SensorDeviceClass.ENERGY,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
|
"BTU",
|
||||||
|
UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
|
1000,
|
||||||
|
1000,
|
||||||
|
SensorDeviceClass.ENERGY,
|
||||||
|
),
|
||||||
|
# Pressure
|
||||||
# Smaller to larger unit, InHg is ~33x larger than hPa -> 1 more decimal
|
# Smaller to larger unit, InHg is ~33x larger than hPa -> 1 more decimal
|
||||||
(
|
(
|
||||||
PRESSURE_HPA,
|
PRESSURE_HPA,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user