mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Add some tests for number and sensor platform
This commit is contained in:
@@ -32,6 +32,7 @@ from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CONF_PLATFORM,
|
||||
UnitOfTemperature,
|
||||
UnitOfVolumeFlowRate,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, State
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
@@ -686,6 +687,22 @@ async def test_restore_number_restore_state(
|
||||
100,
|
||||
38.0,
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.VOLUME_FLOW_RATE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
50.0,
|
||||
"13.2",
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.VOLUME_FLOW_RATE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
13.0,
|
||||
"49.2",
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_custom_unit(
|
||||
|
@@ -36,6 +36,7 @@ from homeassistant.const import (
|
||||
UnitOfSpeed,
|
||||
UnitOfTemperature,
|
||||
UnitOfVolume,
|
||||
UnitOfVolumeFlowRate,
|
||||
UnitOfVolumetricFlux,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, State
|
||||
@@ -581,6 +582,22 @@ async def test_restore_sensor_restore_state(
|
||||
-0.00001,
|
||||
"0",
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.VOLUME_FLOW_RATE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
50.0,
|
||||
"13.2",
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.VOLUME_FLOW_RATE,
|
||||
UnitOfVolumeFlowRate.GALLONS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
13.0,
|
||||
"49.2",
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_custom_unit(
|
||||
|
Reference in New Issue
Block a user