def service(value):
    # Services use same format as entities so we can use same helper.
    if valid_entity_id(value):
        return value
    raise vol.Invalid('Service {} does not match format <domain>.<name>'
                      .format(value))
Validate service.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/config_validation.py/service