Add notify demo data test

This commit is contained in:
Paulus Schoutsen committed 2016-08-09 20:26:17 -07:00
1 parent 492ade7b1a
commit 6bb6a6ebe9
3 files changed
+24 -7

No files matched your search

+7 -4
View File
@@ -44,16 +44,19 @@ NOTIFY_SERVICE_SCHEMA = vol.Schema({
_LOGGER = logging.getLogger(__name__)
def send_message(hass, message, title=None):
def send_message(hass, message, title=None, data=None):
"""Send a notification message."""
data = {
info = {
ATTR_MESSAGE: message
}
if title is not None:
data[ATTR_TITLE] = title
info[ATTR_TITLE] = title
hass.services.call(DOMAIN, SERVICE_NOTIFY, data)
if data is not None:
info[ATTR_DATA] = data
hass.services.call(DOMAIN, SERVICE_NOTIFY, info)
def setup(hass, config):