Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.persistent_notification Namespace Reference

Namespaces

 trigger
 

Classes

class  Notification
 
class  UpdateType
 

Functions

dict[str, Notification_async_get_or_create_notifications (HomeAssistant hass)
 
None _async_send_notification_update (websocket_api.ActiveConnection connection, int msg_id, UpdateType update_type, dict[str, Notification] notifications)
 
None async_create (HomeAssistant hass, str message, str|None title=None, str|None notification_id=None)
 
None async_dismiss (HomeAssistant hass, str notification_id)
 
None async_dismiss_all (HomeAssistant hass)
 
CALLBACK_TYPE async_register_callback (HomeAssistant hass, Callable[[UpdateType, dict[str, Notification]], None] _callback)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
None create (HomeAssistant hass, str message, str|None title=None, str|None notification_id=None)
 
None dismiss (HomeAssistant hass, str notification_id)
 
None websocket_get_notifications (HomeAssistant hass, websocket_api.ActiveConnection connection, Mapping[str, Any] msg)
 
None websocket_subscribe_notifications (HomeAssistant hass, websocket_api.ActiveConnection connection, Mapping[str, Any] msg)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
 
string DOMAIN = "persistent_notification"
 
 Final
 
 SCHEMA_SERVICE_NOTIFICATION
 
 SIGNAL_PERSISTENT_NOTIFICATIONS_UPDATED
 

Detailed Description

Support for displaying persistent notifications.

Function Documentation

◆ _async_get_or_create_notifications()

dict[str, Notification] homeassistant.components.persistent_notification._async_get_or_create_notifications ( HomeAssistant  hass)
private
Get or create notifications data.

Definition at line 124 of file __init__.py.

◆ _async_send_notification_update()

None homeassistant.components.persistent_notification._async_send_notification_update ( websocket_api.ActiveConnection  connection,
int  msg_id,
UpdateType  update_type,
dict[str, Notification notifications 
)
private
Send persistent_notification update.

Definition at line 222 of file __init__.py.

◆ async_create()

None homeassistant.components.persistent_notification.async_create ( HomeAssistant  hass,
str  message,
str | None   title = None,
str | None   notification_id = None 
)
Generate a notification.

Definition at line 97 of file __init__.py.

◆ async_dismiss()

None homeassistant.components.persistent_notification.async_dismiss ( HomeAssistant  hass,
str  notification_id 
)
Remove a notification.

Definition at line 131 of file __init__.py.

◆ async_dismiss_all()

None homeassistant.components.persistent_notification.async_dismiss_all ( HomeAssistant  hass)
Remove all notifications.

Definition at line 145 of file __init__.py.

◆ async_register_callback()

CALLBACK_TYPE homeassistant.components.persistent_notification.async_register_callback ( HomeAssistant  hass,
Callable[[UpdateType, dict[str, Notification]], None]  _callback 
)
Register a callback.

Definition at line 68 of file __init__.py.

◆ async_setup()

bool homeassistant.components.persistent_notification.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the persistent notification component.

Definition at line 158 of file __init__.py.

◆ create()

None homeassistant.components.persistent_notification.create ( HomeAssistant  hass,
str  message,
str | None   title = None,
str | None   notification_id = None 
)
Generate a notification.

Definition at line 79 of file __init__.py.

◆ dismiss()

None homeassistant.components.persistent_notification.dismiss ( HomeAssistant  hass,
str  notification_id 
)
Remove a notification.

Definition at line 90 of file __init__.py.

◆ websocket_get_notifications()

None homeassistant.components.persistent_notification.websocket_get_notifications ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
Mapping[str, Any]  msg 
)
Return a list of persistent_notifications.

Definition at line 208 of file __init__.py.

◆ websocket_subscribe_notifications()

None homeassistant.components.persistent_notification.websocket_subscribe_notifications ( HomeAssistant  hass,
websocket_api.ActiveConnection  connection,
Mapping[str, Any]  msg 
)
Return a list of persistent_notifications.

Definition at line 240 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.persistent_notification._LOGGER = logging.getLogger(__name__)
private

Definition at line 62 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.persistent_notification.CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)

Definition at line 64 of file __init__.py.

◆ DOMAIN

string homeassistant.components.persistent_notification.DOMAIN = "persistent_notification"

Definition at line 27 of file __init__.py.

◆ Final

homeassistant.components.persistent_notification.Final

Definition at line 29 of file __init__.py.

◆ SCHEMA_SERVICE_NOTIFICATION

homeassistant.components.persistent_notification.SCHEMA_SERVICE_NOTIFICATION
Initial value:
1 = vol.Schema(
2  {vol.Required(ATTR_NOTIFICATION_ID): cv.string}
3 )

Definition at line 58 of file __init__.py.

◆ SIGNAL_PERSISTENT_NOTIFICATIONS_UPDATED

homeassistant.components.persistent_notification.SIGNAL_PERSISTENT_NOTIFICATIONS_UPDATED
Initial value:
1 = SignalType[
2  UpdateType, dict[str, Notification]
3 ]("persistent_notifications_updated")

Definition at line 54 of file __init__.py.