Persistent_notification service description (#2407)
* Persistent_notification service description * Add service name to services.yaml
This commit is contained in:
1 parent
659d67f362
commit
2cdef7fb2f
2 files changed
+22
-1
No files matched your search
@@ -4,6 +4,7 @@ A component which is collecting configuration errors.
|
||||
For more details about this component, please refer to the documentation at
|
||||
https://home-assistant.io/components/persistent_notification/
|
||||
"""
|
||||
import os
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -12,6 +13,7 @@ from homeassistant.exceptions import TemplateError
|
||||
from homeassistant.helpers import template, config_validation as cv
|
||||
from homeassistant.helpers.entity import generate_entity_id
|
||||
from homeassistant.util import slugify
|
||||
from homeassistant.config import load_yaml_config_file
|
||||
|
||||
DOMAIN = 'persistent_notification'
|
||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||
@@ -74,7 +76,10 @@ def setup(hass, config):
|
||||
|
||||
hass.states.set(entity_id, message, attr)
|
||||
|
||||
hass.services.register(DOMAIN, SERVICE_CREATE, create_service, {},
|
||||
descriptions = load_yaml_config_file(
|
||||
os.path.join(os.path.dirname(__file__), 'services.yaml'))
|
||||
hass.services.register(DOMAIN, SERVICE_CREATE, create_service,
|
||||
descriptions[DOMAIN][SERVICE_CREATE],
|
||||
SCHEMA_SERVICE_CREATE)
|
||||
|
||||
return True
|
||||
Reference in new issue
Block a user