Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Provide common notify constants."""
2 
3 import logging
4 
5 import voluptuous as vol
6 
8 
9 ATTR_DATA = "data"
10 
11 # Text to notify user of
12 ATTR_MESSAGE = "message"
13 
14 # Target of the (legacy) notification (user, device, etc)
15 ATTR_TARGET = "target"
16 
17 # Recipients for a notification
18 ATTR_RECIPIENTS = "recipients"
19 
20 # Title of notification
21 ATTR_TITLE = "title"
22 
23 DOMAIN = "notify"
24 
25 LOGGER = logging.getLogger(__package__)
26 
27 SERVICE_NOTIFY = "notify"
28 SERVICE_SEND_MESSAGE = "send_message"
29 SERVICE_PERSISTENT_NOTIFICATION = "persistent_notification"
30 
31 NOTIFY_SERVICE_SCHEMA = vol.Schema(
32  {
33  vol.Required(ATTR_MESSAGE): cv.string,
34  vol.Optional(ATTR_TITLE): cv.string,
35  vol.Optional(ATTR_TARGET): vol.All(cv.ensure_list, [cv.string]),
36  vol.Optional(ATTR_DATA): dict,
37  }
38 )