async def test_unique_id(hass):
    'Test unique id option only creates one switch per unique_id.'
    (await async_mock_mqtt_component(hass))
    assert (await async_setup_component(hass, switch.DOMAIN, {switch.DOMAIN: [{'platform': 'mqtt', 'name': 'Test 1', 'state_topic': 'test-topic', 'command_topic': 'command-topic', 'unique_id': 'TOTALLY_UNIQUE'}, {'platform': 'mqtt', 'name': 'Test 2', 'state_topic': 'test-topic', 'command_topic': 'command-topic', 'unique_id': 'TOTALLY_UNIQUE'}]}))
    async_fire_mqtt_message(hass, 'test-topic', 'payload')
    (await hass.async_block_till_done())
    (await hass.async_block_till_done())
    assert (len(hass.states.async_entity_ids()) == 2)
Test unique id option only creates one switch per unique_id.
async def test_unique_id(hass):
    
    (await async_mock_mqtt_component(hass))
    assert (await async_setup_component(hass, switch.DOMAIN, {switch.DOMAIN: [{'platform': 'mqtt', 'name': 'Test 1', 'state_topic': 'test-topic', 'command_topic': 'command-topic', 'unique_id': 'TOTALLY_UNIQUE'}, {'platform': 'mqtt', 'name': 'Test 2', 'state_topic': 'test-topic', 'command_topic': 'command-topic', 'unique_id': 'TOTALLY_UNIQUE'}]}))
    async_fire_mqtt_message(hass, 'test-topic', 'payload')
    (await hass.async_block_till_done())
    (await hass.async_block_till_done())
    assert (len(hass.states.async_entity_ids()) == 2)