Core Classes¶
classDiagram
Notification "1" *-- "*" Envelope
Notification "1" *-- "1" ConditionVariables
Envelope "1" ..> "1" DeliveryMethod
Context "1" o-- "0..*" Scenario
Context "1" o-- "0..*" Snooze
Context "1" *-- "1" Snoozer custom_components.supernotify.delivery_method.DeliveryMethod ¶
Base class for delivery methods.
Sub classes integrste with Home Assistant notification services or alternative notification mechanisms.
| METHOD | DESCRIPTION |
|---|---|
deliver | Delivery implementation |
initialize | Async post-construction initialization |
option | Get an option value from delivery config or method default options |
recipient_target | Pick out delivery appropriate target from a single person’s (recipient) config |
select_target | Confirm if target appropriate for this delivery method |
simplify | Simplify text for delivery methods with speaking or plain text interfaces |
validate_action | Override in subclass if delivery method has fixed action or doesn’t require one |
validate_deliveries | Validate list of deliveries at startup for this method |
deliver(envelope) abstractmethod async ¶
Delivery implementation
envelope (Envelope): envelope to be delivered
initialize() async ¶
Async post-construction initialization
option(option_name, delivery_config) ¶
Get an option value from delivery config or method default options
recipient_target(recipient) ¶
Pick out delivery appropriate target from a single person’s (recipient) config
select_target(target) ¶
Confirm if target appropriate for this delivery method
target (str): Target, typically an entity ID, or an email address, phone number
simplify(text, strip_urls=False) ¶
Simplify text for delivery methods with speaking or plain text interfaces
validate_action(action) ¶
Override in subclass if delivery method has fixed action or doesn’t require one
validate_deliveries() async ¶
Validate list of deliveries at startup for this method
custom_components.supernotify.notification.Notification ¶
Bases: ArchivableObject
| METHOD | DESCRIPTION |
|---|---|
apply_enabled_scenarios | Set media and action_groups from scenario if defined, first come first applied |
base_filename | ArchiveableObject implementation |
contents | ArchiveableObject implementation |
default_media_from_actions | If no media defined, look for iOS / Android actions that have media defined |
initialize | Async post-construction initialization |
record_resolve | Debug support for recording detailed target resolution in archived notification |
apply_enabled_scenarios() ¶
Set media and action_groups from scenario if defined, first come first applied
base_filename() ¶
ArchiveableObject implementation
contents(minimal=False) ¶
ArchiveableObject implementation
default_media_from_actions() ¶
If no media defined, look for iOS / Android actions that have media defined
initialize() async ¶
Async post-construction initialization
record_resolve(delivery_name, category, resolved) ¶
Debug support for recording detailed target resolution in archived notification
custom_components.supernotify.envelope.Envelope ¶
Wrap a notification with a specific set of targets and service data possibly customized for those targets
| METHOD | DESCRIPTION |
|---|---|
__eq__ | Specialized equality check for subset of attributes |
__repr__ | Return a concise string representation of the Envelope. |
core_action_data | Build the core set of |
grab_image | Grab an image from a camera, snapshot URL, MQTT Image etc |
__eq__(other) ¶
Specialized equality check for subset of attributes
__repr__() ¶
Return a concise string representation of the Envelope.
The returned string includes the envelope’s message, title, and delivery name in the form: Envelope(message=
Primarily intended for debugging and logging; note that attribute values are inserted directly and may not be quoted or escaped.
core_action_data() ¶
Build the core set of service_data dict to pass to underlying notify service
grab_image() async ¶
Grab an image from a camera, snapshot URL, MQTT Image etc
custom_components.supernotify.scenario.Scenario ¶
| METHOD | DESCRIPTION |
|---|---|
attributes | Return scenario attributes |
contents | Archive friendly view of scenario |
evaluate | Evaluate scenario conditions |
trace | Trace scenario delivery |
validate | Validate Home Assistant conditiion definition at initiation |
attributes(include_condition=True, include_trace=False) ¶
Return scenario attributes
contents(minimal=False) ¶
Archive friendly view of scenario
evaluate(condition_variables=None) async ¶
Evaluate scenario conditions
trace(condition_variables=None, config=None) async ¶
Trace scenario delivery
validate(valid_deliveries=None, valid_action_groups=None) async ¶
Validate Home Assistant conditiion definition at initiation
custom_components.supernotify.snoozer.Snooze ¶
custom_components.supernotify.ConditionVariables dataclass ¶
Variables presented to all condition evaluations
Attributes¶
applied_scenarios (list[str]): Scenarios that have been applied
required_scenarios (list[str]): Scenarios that must be applied
constrain_scenarios (list[str]): Only scenarios in this list, or in explicit apply_scenarios, can be applied
notification_priority (str): Priority of the notification
notification_message (str): Message of the notification
notification_title (str): Title of the notification
occupancy (list[str]): List of occupancy scenarios