Add DurationConverter (#108865)
* Add DurationConverter * Update withings snapshots * Add sensor test * Fix tests * Update snapshots after #108902 was merged
This commit is contained in:
parent
e7d5ae7ef6
commit
b409933d19
7 changed files with 141 additions and 22 deletions
|
@ -37,6 +37,7 @@ from homeassistant.const import (
|
|||
UnitOfPressure,
|
||||
UnitOfSpeed,
|
||||
UnitOfTemperature,
|
||||
UnitOfTime,
|
||||
UnitOfVolume,
|
||||
UnitOfVolumeFlowRate,
|
||||
UnitOfVolumetricFlux,
|
||||
|
@ -599,6 +600,22 @@ async def test_restore_sensor_restore_state(
|
|||
13.0,
|
||||
"49.2",
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.DURATION,
|
||||
UnitOfTime.SECONDS,
|
||||
UnitOfTime.HOURS,
|
||||
UnitOfTime.HOURS,
|
||||
5400.0,
|
||||
"1.5000",
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.DURATION,
|
||||
UnitOfTime.DAYS,
|
||||
UnitOfTime.MINUTES,
|
||||
UnitOfTime.MINUTES,
|
||||
0.5,
|
||||
"720.0",
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_custom_unit(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue