1 """Demo notification entity."""
3 from __future__
import annotations
6 DOMAIN
as NOTIFY_DOMAIN,
15 EVENT_NOTIFY =
"notify"
20 config_entry: ConfigEntry,
21 async_add_entities: AddEntitiesCallback,
23 """Set up the demo entity platform."""
28 """Implement demo notification platform."""
30 _attr_has_entity_name =
True
38 """Initialize the Demo button entity."""
42 identifiers={(NOTIFY_DOMAIN, unique_id)},
47 """Send a message to a user."""
48 event_notification = {
"message": message}
50 event_notification[
"title"] = title
51 self.
hasshass.bus.async_fire(EVENT_NOTIFY, event_notification)
None async_send_message(self, str message, str|None title=None)
None __init__(self, str unique_id, str device_name)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)