From d58af0f4e0ad5f9477ecf3532b06db52e00950eb Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Sat, 3 Feb 2024 07:45:57 +1100 Subject: [PATCH] =?UTF-8?q?NTFY=20priority=20#553=20=F0=9F=9A=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/plugins/_publisher_ntfy/config.json | 15 +++++++++++++++ front/plugins/_publisher_ntfy/ntfy.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/front/plugins/_publisher_ntfy/config.json b/front/plugins/_publisher_ntfy/config.json index e3079caf..acd8465f 100755 --- a/front/plugins/_publisher_ntfy/config.json +++ b/front/plugins/_publisher_ntfy/config.json @@ -385,6 +385,21 @@ "language_code": "es_es", "string" : "Ingrese la contraseña si necesita (host) una instancia con autenticación habilitada." }] + }, + { + "function": "PRIORITY", + "type": "text.select", + "default_value":"urgent", + "options": ["urgent", "high", "default" , "low" , "min" ], + "localized": ["name", "description"], + "name" : [{ + "language_code": "en_us", + "string" : "Message priority" + }], + "description": [{ + "language_code": "en_us", + "string" : "All NTFY messages have a priority, which defines how urgently your phone notifies you. On Android, you can set custom notification sounds and vibration patterns on your phone to map to these priorities (see Android config)." + }] } ] } diff --git a/front/plugins/_publisher_ntfy/ntfy.py b/front/plugins/_publisher_ntfy/ntfy.py index dd97bbc0..18a8ee58 100755 --- a/front/plugins/_publisher_ntfy/ntfy.py +++ b/front/plugins/_publisher_ntfy/ntfy.py @@ -88,7 +88,7 @@ def send(html, text): headers = { "Title": "Pi.Alert Notification", "Actions": "view, Open Dashboard, "+ get_setting_value('REPORT_DASHBOARD_URL'), - "Priority": "urgent", + "Priority": get_setting_value('NTFY_PRIORITY'), "Tags": "warning" }