def setup(hass, config):
    import webbrowser

    hass.services.register(DOMAIN, SERVICE_BROWSE_URL,
                           lambda service:
                           webbrowser.open(service.data[ATTR_URL]),
                           schema=SERVICE_BROWSE_URL_SCHEMA)

    return True
Listen for browse_url events.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/browser.py/setup