async def start_emulated_hue_bridge(event):
    'Start the emulated hue bridge.'
    upnp_listener.start()
    nonlocal site
    nonlocal runner
    runner = web.AppRunner(app)
    (await runner.setup())
    site = web.TCPSite(runner, config.host_ip_addr, config.listen_port)
    try:
        (await site.start())
    except OSError as error:
        _LOGGER.error('Failed to create HTTP server at port %d: %s', config.listen_port, error)
    else:
        hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_emulated_hue_bridge)
Start the emulated hue bridge.
async def start_emulated_hue_bridge(event):
    
    upnp_listener.start()
    nonlocal site
    nonlocal runner
    runner = web.AppRunner(app)
    (await runner.setup())
    site = web.TCPSite(runner, config.host_ip_addr, config.listen_port)
    try:
        (await site.start())
    except OSError as error:
        _LOGGER.error('Failed to create HTTP server at port %d: %s', config.listen_port, error)
    else:
        hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_emulated_hue_bridge)