Jan Bouwhuis 10076e6523
Add notify entity component (#110950)
* Add notify entity component

* Device classes, restore state, icons

* Add icons file

* Add tests for kitchen_sink

* Remove notify from no_entity_platforms in hassfest icons, translation link

* ruff

* Remove `data` feature

* Only message support

* Complete initial device classes

* mypy pylint

* Remove device_class implementation

* format

* Follow up comments

* Remove _attr_supported_features

* Use setup_test_component_platform

* User helper at other places

* last comment

* Add entry unload test and non async test

* Avoid default mutable object in constructor
2024-04-11 12:04:08 +02:00

39 lines
842 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 (legacy) notification (user, device, etc)
ATTR_TARGET = "target"
# Recipients for a notification
ATTR_RECIPIENTS = "recipients"
# Title of notification
ATTR_TITLE = "title"
DOMAIN = "notify"
LOGGER = logging.getLogger(__package__)
SERVICE_NOTIFY = "notify"
SERVICE_SEND_MESSAGE = "send_message"
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,
}
)