def get_service(hass, config):
    """Return the notify service."""
    if not validate_config({DOMAIN: config}, {DOMAIN: [CONF_HOST, CONF_NAME]},
                           _LOGGER):
        return None

    host = config.get(CONF_HOST, None)

    if not host:
        _LOGGER.error('No host provided.')
        return None

    from pylgtv import WebOsClient
    from pylgtv import PyLGTVPairException

    client = WebOsClient(host)

    try:
        client.register()
    except PyLGTVPairException:
        _LOGGER.error('Pairing failed.')
        return None
    except __HOLE__:
        _LOGGER.error('Host unreachable.')
        return None

    return LgWebOSNotificationService(client)


# pylint: disable=too-few-public-methods
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/notify/webostv.py/get_service