Removed decorator callback

The decorator callback was not actually necessary so it was removed and
replaced with a partial function instead.
This commit is contained in:
Ryan Kraus 2016-01-25 00:14:16 -05:00
parent bcdfc555e0
commit 8406f81811
2 changed files with 6 additions and 16 deletions

View file

@ -15,18 +15,13 @@ CONF_SERVICE_DATA = 'data'
_LOGGER = logging.getLogger(__name__)
def _callback(action, *args, **kwargs):
""" adds HASS to callback arguments """
action(HASS, *args, **kwargs)
def service(domain, service_name):
""" Decorator factory to register a service """
def register_service_decorator(action):
""" Decorator to register a service """
HASS.services.register(domain, service_name,
functools.partial(_callback, action))
functools.partial(action, HASS))
return action
return register_service_decorator