mirror of
https://github.com/ep1cman/unifi-protect-backup.git
synced 2025-12-05 23:53:30 +00:00
19 lines
540 B
Python
19 lines
540 B
Python
"""A 'singleton' module for registering apprise notifiers."""
|
|
|
|
import apprise
|
|
|
|
notifier = apprise.Apprise()
|
|
|
|
|
|
def add_notification_service(url):
|
|
"""Add apprise URI with support for tags e.g. TAG1,TAG2=PROTOCOL://settings."""
|
|
config = apprise.AppriseConfig()
|
|
config.add_config(url, format="text")
|
|
|
|
# If not tags are specified, default to errors otherwise ALL logging will
|
|
# be spammed to the notification service
|
|
if not config.servers()[0].tags:
|
|
config.servers()[0].tags = {"ERROR"}
|
|
|
|
notifier.add(config)
|