1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Normalize temperature statistics to °C (#52297)

* Normalize temperature statistics to °C

* Fix tests

* Support temperature conversion to and from K, improve tests

* Fix test

* Add tests, pylint
This commit is contained in:
Erik Montnemery
2021-06-30 14:17:58 +02:00
committed by GitHub
parent 508f9a8296
commit 0476c7f9ee
7 changed files with 153 additions and 12 deletions

View File

@@ -106,7 +106,7 @@ def test_temperature_same_unit():
def test_temperature_unknown_unit():
"""Test no conversion happens if unknown unit."""
with pytest.raises(ValueError):
METRIC_SYSTEM.temperature(5, "K")
METRIC_SYSTEM.temperature(5, "abc")
def test_temperature_to_metric():