Fix temperature interval Thermostat HomeKit (#18192)

* Will round to nearest .0 or .5
This commit is contained in:
cdce8p
2018-11-04 22:04:51 +01:00
committed by Paulus Schoutsen
parent 9a6c229b1d
commit 959fa81ea6
5 changed files with 42 additions and 27 deletions

View File

@@ -99,13 +99,13 @@ def test_convert_to_float():
def test_temperature_to_homekit():
"""Test temperature conversion from HA to HomeKit."""
assert temperature_to_homekit(20.46, TEMP_CELSIUS) == 20.5
assert temperature_to_homekit(92.1, TEMP_FAHRENHEIT) == 33.4
assert temperature_to_homekit(92.1, TEMP_FAHRENHEIT) == 33.5
def test_temperature_to_states():
"""Test temperature conversion from HomeKit to HA."""
assert temperature_to_states(20, TEMP_CELSIUS) == 20.0
assert temperature_to_states(20.2, TEMP_FAHRENHEIT) == 68.4
assert temperature_to_states(20.2, TEMP_FAHRENHEIT) == 68.5
def test_density_to_air_quality():