From 4220169206bdd554eaa4fe39257d2b21b7816c7f Mon Sep 17 00:00:00 2001 From: Joshua <63589370+Final-Hawk@users.noreply.github.com> Date: Sun, 24 Jul 2022 17:50:26 +1000 Subject: [PATCH] Fix Pushsafer Support and Duplicate NTFY Messages Make pushsafer request use the existing requests module as the module it relied on is not installed. Remove the sending of duplicate NTFY Messages --- back/pialert.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index 5930599f..76dc2db2 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -1377,11 +1377,6 @@ def email_reporting (): send_pushsafer (mail_text) else : print (' Skip PUSHSAFER...') - if REPORT_NTFY : - print (' Sending report by NTFY...') - send_ntfy (mail_text) - else : - print (' Skip NTFY...') else : print (' No changes to report...') @@ -1426,10 +1421,8 @@ def send_pushsafer (_Text): "ut" : 'Open Pi.Alert', "k" : PUSHSAFER_TOKEN, } - - request = Request(url, urlencode(post_fields).encode()) - json = urlopen(request).read().decode() - # print(json) + requests.post(url, data=post_fields) + #-------------------------------------------------------------------------------