mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +00:00
Drop minus sign on negative zero (#86939)
* Drop minus sign on negative zero * Add tests
This commit is contained in:
@@ -537,6 +537,15 @@ async def test_custom_unit(
|
||||
"29.921", # Native precision is 3
|
||||
"1013.24", # One digit of precision removed when converting
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
|
||||
UnitOfPressure.INHG,
|
||||
UnitOfPressure.HPA,
|
||||
-0.0001,
|
||||
3,
|
||||
"0.000", # Native precision is 3
|
||||
"0.00", # One digit of precision removed when converting
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_native_precision_scaling(
|
||||
@@ -594,6 +603,14 @@ async def test_native_precision_scaling(
|
||||
"1000.000",
|
||||
"1000.0000",
|
||||
),
|
||||
(
|
||||
SensorDeviceClass.DISTANCE,
|
||||
UnitOfLength.KILOMETERS,
|
||||
1,
|
||||
-0.04,
|
||||
"-0.040",
|
||||
"0.0", # Make sure minus is dropped
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_custom_precision_native_precision(
|
||||
|
||||
Reference in New Issue
Block a user