* Support notification_id in notify.persistent_notification * Apply suggestions from code review Co-authored-by: Scott Giminiani <ScottG489@Gmail.com> --------- Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Scott Giminiani <ScottG489@Gmail.com>
33 lines
730 B
Python
33 lines
730 B
Python
"""Provide common notify constants."""
|
|
import logging
|
|
|
|
import voluptuous as vol
|
|
|
|
import homeassistant.helpers.config_validation as cv
|
|
|
|
ATTR_DATA = "data"
|
|
|
|
# Text to notify user of
|
|
ATTR_MESSAGE = "message"
|
|
|
|
# Target of the notification (user, device, etc)
|
|
ATTR_TARGET = "target"
|
|
|
|
# Title of notification
|
|
ATTR_TITLE = "title"
|
|
|
|
DOMAIN = "notify"
|
|
|
|
LOGGER = logging.getLogger(__package__)
|
|
|
|
SERVICE_NOTIFY = "notify"
|
|
SERVICE_PERSISTENT_NOTIFICATION = "persistent_notification"
|
|
|
|
NOTIFY_SERVICE_SCHEMA = vol.Schema(
|
|
{
|
|
vol.Required(ATTR_MESSAGE): cv.template,
|
|
vol.Optional(ATTR_TITLE): cv.template,
|
|
vol.Optional(ATTR_TARGET): vol.All(cv.ensure_list, [cv.string]),
|
|
vol.Optional(ATTR_DATA): dict,
|
|
}
|
|
)
|