Add service descriptions

This commit is contained in:
Paulus Schoutsen committed 2015-09-26 23:17:04 -07:00
1 parent 9a6b2c1831
commit 4e3bd5f2a9
20 files changed
+180 -49

No files matched your search

+7 -1
View File
@@ -6,7 +6,9 @@ Provides functionality to notify people.
"""
from functools import partial
import logging
import os
from homeassistant.config import load_yaml_config_file
from homeassistant.loader import get_component
from homeassistant.helpers import config_per_platform
@@ -36,6 +38,9 @@ def setup(hass, config):
""" Sets up notify services. """
success = False
descriptions = load_yaml_config_file(
os.path.join(os.path.dirname(__file__), 'services.yaml'))
for platform, p_config in config_per_platform(config, DOMAIN, _LOGGER):
# get platform
notify_implementation = get_component(
@@ -69,7 +74,8 @@ def setup(hass, config):
# register service
service_call_handler = partial(notify_message, notify_service)
service_notify = p_config.get(CONF_NAME, SERVICE_NOTIFY)
hass.services.register(DOMAIN, service_notify, service_call_handler)
hass.services.register(DOMAIN, service_notify, service_call_handler,
descriptions.get(service_notify))
success = True
return success