Merge pull request #1123 from dougmaitelli/feat/apprise-tag

Add support for Apprise Tags
This commit is contained in:
Jokob @NetAlertX
2025-07-29 07:22:24 +10:00
committed by GitHub
2 changed files with 69 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ def main():
#-------------------------------------------------------------------------------
def check_config():
if get_setting_value('APPRISE_URL') == '' or get_setting_value('APPRISE_HOST') == '':
if get_setting_value('APPRISE_HOST') == '' or (get_setting_value('APPRISE_URL') == '' and get_setting_value('APPRISE_TAG') == ''):
return False
else:
return True
@@ -106,8 +106,11 @@ def send(html, text):
# Define Apprise compatible payload (https://github.com/caronc/apprise-api#stateless-solution)
target_key = "tag" if get_setting_value('APPRISE_TARGETTYPE') == 'tag' else "urls"
target_value = get_setting_value('APPRISE_TAG') if target_key == 'tag' else get_setting_value('APPRISE_URL')
_json_payload = {
"urls": get_setting_value('APPRISE_URL'),
target_key: target_value,
"title": "NetAlertX Notifications",
"format": get_setting_value('APPRISE_PAYLOAD'),
"body": payloadData

View File

@@ -422,6 +422,38 @@
}
]
},
{
"function": "TARGETTYPE",
"type": {
"dataType": "string",
"elements": [
{ "elementType": "select", "elementOptions": [], "transformers": [] }
]
},
"default_value": "url",
"options": ["url", "tag"],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Target type"
},
{
"language_code": "es_es",
"string": "Tipo de alvo"
}
],
"description": [
{
"language_code": "en_us",
"string": "Select the target type sent to Apprise."
},
{
"language_code": "es_es",
"string": "Seleccione el tipo de alvo enviada a Apprise."
}
]
},
{
"function": "URL",
"type": {
@@ -454,6 +486,38 @@
}
]
},
{
"function": "TAG",
"type": {
"dataType": "string",
"elements": [
{ "elementType": "input", "elementOptions": [], "transformers": [] }
]
},
"default_value": "",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Apprise notification tag"
},
{
"language_code": "es_es",
"string": "Tag de notificación de Apprise"
}
],
"description": [
{
"language_code": "en_us",
"string": "Apprise notification target tag."
},
{
"language_code": "es_es",
"string": "Informar de la tag de destino de la notificación."
}
]
},
{
"function": "PAYLOAD",
"type": {