- 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:
leiweibau
2022-07-23 21:19:30 +02:00
parent 6bfa7d5816
commit 3f304a02ff
4 changed files with 57 additions and 7 deletions

View File

@@ -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