コード例 #1
0
def test_speed_to_homekit():
    """Test speed conversion from HA to Homekit."""
    speed_mapping = HomeKitSpeedMapping(['off', 'low', 'high'])
    assert speed_mapping.speed_to_homekit(None) is None
    assert speed_mapping.speed_to_homekit('off') == 0
    assert speed_mapping.speed_to_homekit('low') == 50
    assert speed_mapping.speed_to_homekit('high') == 100
コード例 #2
0
ファイル: test_util.py プロジェクト: alexlia/homeassistant
def test_speed_to_homekit():
    """Test speed conversion from HA to Homekit."""
    speed_mapping = HomeKitSpeedMapping(["off", "low", "high"])
    assert speed_mapping.speed_to_homekit(None) is None
    assert speed_mapping.speed_to_homekit("off") == 0
    assert speed_mapping.speed_to_homekit("low") == 50
    assert speed_mapping.speed_to_homekit("high") == 100
コード例 #3
0
ファイル: test_util.py プロジェクト: arsaboo/home-assistant
def test_speed_to_homekit():
    """Test speed conversion from HA to Homekit."""
    speed_mapping = HomeKitSpeedMapping(['off', 'low', 'high'])
    assert speed_mapping.speed_to_homekit('off') == 0
    assert speed_mapping.speed_to_homekit('low') == 50
    assert speed_mapping.speed_to_homekit('high') == 100