mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 13:45:12 +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,
|
ATTR_UNIT_OF_MEASUREMENT,
|
||||||
CONF_PLATFORM,
|
CONF_PLATFORM,
|
||||||
UnitOfTemperature,
|
UnitOfTemperature,
|
||||||
|
UnitOfVolumeFlowRate,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, State
|
from homeassistant.core import HomeAssistant, State
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
@@ -686,6 +687,22 @@ async def test_restore_number_restore_state(
|
|||||||
100,
|
100,
|
||||||
38.0,
|
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(
|
async def test_custom_unit(
|
||||||
|
@@ -36,6 +36,7 @@ from homeassistant.const import (
|
|||||||
UnitOfSpeed,
|
UnitOfSpeed,
|
||||||
UnitOfTemperature,
|
UnitOfTemperature,
|
||||||
UnitOfVolume,
|
UnitOfVolume,
|
||||||
|
UnitOfVolumeFlowRate,
|
||||||
UnitOfVolumetricFlux,
|
UnitOfVolumetricFlux,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, State
|
from homeassistant.core import HomeAssistant, State
|
||||||
@@ -581,6 +582,22 @@ async def test_restore_sensor_restore_state(
|
|||||||
-0.00001,
|
-0.00001,
|
||||||
"0",
|
"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(
|
async def test_custom_unit(
|
||||||
|
Reference in New Issue
Block a user