async def test_form_ssdp_aborts_if_serial_already_exists(hass):
    'Test we abort if the serial is already configured.'
    (await setup.async_setup_component(hass, 'persistent_notification', {}))
    entry = MockConfigEntry(domain=UNIFI_DOMAIN, data={'controller': {'host': '1.2.3.4', 'site': 'site_id'}}, unique_id='e0:63:da:20:14:a9')
    entry.add_to_hass(hass)
    result = (await hass.config_entries.flow.async_init(UNIFI_DOMAIN, context={'source': config_entries.SOURCE_SSDP}, data={'friendlyName': 'UniFi Dream Machine', 'modelDescription': 'UniFi Dream Machine Pro', 'ssdp_location': 'http://192.168.208.1:41417/rootDesc.xml', 'serialNumber': 'e0:63:da:20:14:a9'}))
    assert (result['type'] == 'abort')
    assert (result['reason'] == 'already_configured')
Test we abort if the serial is already configured.
async def test_form_ssdp_aborts_if_serial_already_exists(hass):
    
    (await setup.async_setup_component(hass, 'persistent_notification', {}))
    entry = MockConfigEntry(domain=UNIFI_DOMAIN, data={'controller': {'host': '1.2.3.4', 'site': 'site_id'}}, unique_id='e0:63:da:20:14:a9')
    entry.add_to_hass(hass)
    result = (await hass.config_entries.flow.async_init(UNIFI_DOMAIN, context={'source': config_entries.SOURCE_SSDP}, data={'friendlyName': 'UniFi Dream Machine', 'modelDescription': 'UniFi Dream Machine Pro', 'ssdp_location': 'http://192.168.208.1:41417/rootDesc.xml', 'serialNumber': 'e0:63:da:20:14:a9'}))
    assert (result['type'] == 'abort')
    assert (result['reason'] == 'already_configured')