Improve stability of homekit media players (#35080)
This commit is contained in:
1 parent
a083eb334e
commit
bd882fa4e4
5 files changed
+125
-35
No files matched your search
@@ -22,6 +22,7 @@ from homeassistant.components.homekit.const import (
|
||||
from homeassistant.components.homekit.util import (
|
||||
HomeKitSpeedMapping,
|
||||
SpeedRange,
|
||||
cleanup_name_for_homekit,
|
||||
convert_to_float,
|
||||
density_to_air_quality,
|
||||
dismiss_setup_message,
|
||||
@@ -172,6 +173,19 @@ def test_convert_to_float():
|
||||
assert convert_to_float(None) is None
|
||||
|
||||
|
||||
def test_cleanup_name_for_homekit():
|
||||
"""Ensure name sanitize works as expected."""
|
||||
|
||||
assert cleanup_name_for_homekit("abc") == "abc"
|
||||
assert cleanup_name_for_homekit("a b c") == "a b c"
|
||||
assert cleanup_name_for_homekit("ab_c") == "ab c"
|
||||
assert (
|
||||
cleanup_name_for_homekit('ab!@#$%^&*()-=":.,><?//\\ frog')
|
||||
== "ab--#---&----- -.,------ frog"
|
||||
)
|
||||
assert cleanup_name_for_homekit("の日本_語文字セット") == "の日本 語文字セット"
|
||||
|
||||
|
||||
def test_temperature_to_homekit():
|
||||
"""Test temperature conversion from HA to HomeKit."""
|
||||
assert temperature_to_homekit(20.46, TEMP_CELSIUS) == 20.5
|
||||
|
||||
Reference in new issue
Block a user