async def test_default_availability_payload(hass, mqtt_mock):
    'Test availability by default payload with defined topic.'
    config = deepcopy(DEFAULT_CONFIG)
    config.update({'availability_topic': 'availability-topic'})
    assert (await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config}))
    state = hass.states.get('vacuum.mqtttest')
    assert (state.state == STATE_UNAVAILABLE)
    async_fire_mqtt_message(hass, 'availability-topic', 'online')
    state = hass.states.get('vacuum.mqtttest')
    assert (STATE_UNAVAILABLE != state.state)
    async_fire_mqtt_message(hass, 'availability-topic', 'offline')
    state = hass.states.get('vacuum.mqtttest')
    assert (state.state == STATE_UNAVAILABLE)
Test availability by default payload with defined topic.
async def test_default_availability_payload(hass, mqtt_mock):
    
    config = deepcopy(DEFAULT_CONFIG)
    config.update({'availability_topic': 'availability-topic'})
    assert (await async_setup_component(hass, vacuum.DOMAIN, {vacuum.DOMAIN: config}))
    state = hass.states.get('vacuum.mqtttest')
    assert (state.state == STATE_UNAVAILABLE)
    async_fire_mqtt_message(hass, 'availability-topic', 'online')
    state = hass.states.get('vacuum.mqtttest')
    assert (STATE_UNAVAILABLE != state.state)
    async_fire_mqtt_message(hass, 'availability-topic', 'offline')
    state = hass.states.get('vacuum.mqtttest')
    assert (state.state == STATE_UNAVAILABLE)