Add notify demo data test
This commit is contained in:
1 parent
492ade7b1a
commit
6bb6a6ebe9
3 files changed
+24
-7
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user