Core Classes¶
Info
See the Class Diagram for how these relate to each other.
custom_components.supernotify.transport.Transport ¶
Base class for delivery transports.
Sub classes integrste with Home Assistant notification services or alternative notification mechanisms.
| METHOD | DESCRIPTION |
|---|---|
deliver | Delivery implementation |
initialize | Async post-construction initialization |
simplify | Simplify text for delivery transports with speaking or plain text interfaces |
validate_action | Override in subclass if transport has fixed action or doesn't require one |
deliver(envelope) abstractmethod async ¶
Delivery implementation
envelope (Envelope): envelope to be delivered
initialize() async ¶
Async post-construction initialization
simplify(text, strip_urls=False) ¶
Simplify text for delivery transports with speaking or plain text interfaces
validate_action(action) ¶
Override in subclass if transport has fixed action or doesn't require one
custom_components.supernotify.notification.Notification ¶
Bases: ArchivableObject
flowchart TD
custom_components.supernotify.notification.Notification[Notification]
custom_components.supernotify.archive.ArchivableObject[ArchivableObject]
custom_components.supernotify.archive.ArchivableObject --> custom_components.supernotify.notification.Notification
click custom_components.supernotify.notification.Notification href "" "custom_components.supernotify.notification.Notification"
click custom_components.supernotify.archive.ArchivableObject href "" "custom_components.supernotify.archive.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 |
hash | Alpha hash to reduce noise from messages with timestamps or incrementing counts |
initialize | Async post-construction initialization |
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
hash() ¶
Alpha hash to reduce noise from messages with timestamps or incrementing counts
initialize() async ¶
Async post-construction initialization
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 condition execution |
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, strict=False, validate=False) async ¶
Trace scenario condition execution
validate(valid_deliveries=None, valid_action_groups=None) async ¶
Validate Home Assistant conditiion definition at initiation
custom_components.supernotify.model.Target ¶
custom_components.supernotify.model.DeliveryConfig ¶
custom_components.supernotify.model.TransportConfig ¶
custom_components.supernotify.snoozer.Snooze ¶
custom_components.supernotify.model.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
custom_components.supernotify.people.PeopleRegistry ¶
| METHOD | DESCRIPTION |
|---|---|
mobile_devices_for_person | Auto detect mobile_app targets for a person. |
mobile_devices_for_person(person_entity_id, validate_targets=False) ¶
Auto detect mobile_app targets for a person.
Targets not currently validated as async registration may not be complete at this stage
person_entity_id (str): _description_
validate_targets (bool, optional): _description_. Defaults to False.
list: mobile target actions for this person