Refactor notification titles to allow for them to be None, this also includes a change in Telegram to only include the title if it's present, and to use a Markdown parse mode for messages (#3100)

This commit is contained in:
Lewis Juggins authored and Paulus Schoutsen committed 2016-09-01 14:35:46 +01:00
1 parent 5036bb0bc6
commit 0bcfb65a30
18 files changed
+50 -34

No files matched your search

+3 -2
View File
@@ -14,7 +14,8 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (
ATTR_TITLE, ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService)
ATTR_TITLE, ATTR_TITLE_DEFAULT, ATTR_DATA, PLATFORM_SCHEMA,
BaseNotificationService)
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, CONF_PORT)
_LOGGER = logging.getLogger(__name__)
@@ -120,7 +121,7 @@ class MailNotificationService(BaseNotificationService):
Will send plain text normally, or will build a multipart HTML message
with inline image attachments if images config is defined.
"""
subject = kwargs.get(ATTR_TITLE)
subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
data = kwargs.get(ATTR_DATA)
if data: