1 """Demo platform that offers a fake notify entity."""
3 from __future__
import annotations
17 config_entry: ConfigEntry,
18 async_add_entities: AddEntitiesCallback,
20 """Set up the demo notify entity platform."""
24 unique_id=
"just_notify_me",
26 entity_name=
"Personal notifier",
29 unique_id=
"just_notify_me_title",
31 entity_name=
"Personal notifier with title",
32 supported_features=NotifyEntityFeature.TITLE,
39 """Representation of a demo notify entity."""
41 _attr_has_entity_name =
True
42 _attr_should_poll =
False
48 entity_name: str |
None,
51 """Initialize the Demo button entity."""
55 identifiers={(DOMAIN, unique_id)},
61 """Send out a persistent notification."""
62 persistent_notification.async_create(
63 self.
hasshass, message, title
or "Demo notification"
None async_send_message(self, str message, str|None title=None)
None __init__(self, str unique_id, str device_name, str|None entity_name, NotifyEntityFeature supported_features=NotifyEntityFeature(0))
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)