def service(domain, service_name):
    def register_service_decorator(action):
        """Decorator to register a service."""
        HASS.services.register(domain, service_name,
                               functools.partial(action, HASS))
        return action

    return register_service_decorator
Decorator factory to register a service.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/service.py/service