Exemplo n.º 1
0
async def test_set_away_mode(hass, setup_comp_2):
    """Test the setting away mode."""
    common.async_set_temperature(hass, 23)
    await hass.async_block_till_done()
    common.async_set_away_mode(hass, True)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 16 == state.attributes.get('temperature')
async def test_set_away_mode(hass, setup_comp_2):
    """Test the setting away mode."""
    common.async_set_temperature(hass, 23)
    await hass.async_block_till_done()
    common.async_set_away_mode(hass, True)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 16 == state.attributes.get('temperature')
Exemplo n.º 3
0
async def test_turn_away_mode_on_cooling(hass, setup_comp_3):
    """Test the setting away mode when cooling."""
    _setup_sensor(hass, 25)
    await hass.async_block_till_done()
    common.async_set_temperature(hass, 19)
    await hass.async_block_till_done()
    common.async_set_away_mode(hass, True)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 30 == state.attributes.get('temperature')
async def test_turn_away_mode_on_cooling(hass, setup_comp_3):
    """Test the setting away mode when cooling."""
    _setup_sensor(hass, 25)
    await hass.async_block_till_done()
    common.async_set_temperature(hass, 19)
    await hass.async_block_till_done()
    common.async_set_away_mode(hass, True)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 30 == state.attributes.get('temperature')
Exemplo n.º 5
0
async def test_set_away_mode_and_restore_prev_temp(hass, setup_comp_2):
    """Test the setting and removing away mode.

    Verify original temperature is restored.
    """
    common.async_set_temperature(hass, 23)
    await hass.async_block_till_done()
    common.async_set_away_mode(hass, True)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 16 == state.attributes.get('temperature')
    common.async_set_away_mode(hass, False)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 23 == state.attributes.get('temperature')
async def test_set_away_mode_and_restore_prev_temp(hass, setup_comp_2):
    """Test the setting and removing away mode.

    Verify original temperature is restored.
    """
    common.async_set_temperature(hass, 23)
    await hass.async_block_till_done()
    common.async_set_away_mode(hass, True)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 16 == state.attributes.get('temperature')
    common.async_set_away_mode(hass, False)
    await hass.async_block_till_done()
    state = hass.states.get(ENTITY)
    assert 23 == state.attributes.get('temperature')