Exemplo n.º 1
0
def test_speed_to_states():
    """Test speed conversion from Homekit to HA."""
    speed_mapping = HomeKitSpeedMapping(['off', 'low', 'high'])
    assert speed_mapping.speed_to_states(0) == 'off'
    assert speed_mapping.speed_to_states(33) == 'off'
    assert speed_mapping.speed_to_states(34) == 'low'
    assert speed_mapping.speed_to_states(50) == 'low'
    assert speed_mapping.speed_to_states(66) == 'low'
    assert speed_mapping.speed_to_states(67) == 'high'
    assert speed_mapping.speed_to_states(100) == 'high'
Exemplo n.º 2
0
def test_speed_to_states():
    """Test speed conversion from Homekit to HA."""
    speed_mapping = HomeKitSpeedMapping(['off', 'low', 'high'])
    assert speed_mapping.speed_to_states(0) == 'off'
    assert speed_mapping.speed_to_states(33) == 'off'
    assert speed_mapping.speed_to_states(34) == 'low'
    assert speed_mapping.speed_to_states(50) == 'low'
    assert speed_mapping.speed_to_states(66) == 'low'
    assert speed_mapping.speed_to_states(67) == 'high'
    assert speed_mapping.speed_to_states(100) == 'high'
Exemplo n.º 3
0
def test_speed_to_states():
    """Test speed conversion from Homekit to HA."""
    speed_mapping = HomeKitSpeedMapping(["off", "low", "high"])
    assert speed_mapping.speed_to_states(-1) == "off"
    assert speed_mapping.speed_to_states(0) == "off"
    assert speed_mapping.speed_to_states(33) == "off"
    assert speed_mapping.speed_to_states(34) == "low"
    assert speed_mapping.speed_to_states(50) == "low"
    assert speed_mapping.speed_to_states(66) == "low"
    assert speed_mapping.speed_to_states(67) == "high"
    assert speed_mapping.speed_to_states(100) == "high"