mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
partial merge https://github.com/leiweibau/Pi.Alert/pull/9
- merged timezone configuration with pialert.conf as the settings file - merged NTFY support - the variable REPORT_DASHBOARD_URL was merged (duplication in Pushsafer and NTFY) - update README
This commit is contained in:
@@ -1363,6 +1363,11 @@ 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...')
|
||||
|
||||
@@ -1404,6 +1409,18 @@ def send_pushsafer (_Text):
|
||||
json = urlopen(request).read().decode()
|
||||
# print(json)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
def send_ntfy (_Text):
|
||||
requests.post("https://ntfy.sh/{}".format(NTFY_TOPIC),
|
||||
data=_Text,
|
||||
headers={
|
||||
"Title": "Pi.Alert Notification",
|
||||
"Click": REPORT_DASHBOARD_URL,
|
||||
"Priority": "urgent",
|
||||
"Tags": "warning"
|
||||
})
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def format_report_section (pActive, pSection, pTable, pText, pHTML):
|
||||
global mail_text
|
||||
|
||||
Reference in New Issue
Block a user