mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
Update Pushover.py
Changing priority depending on ZVEI / RIC
This commit is contained in:
parent
942a738704
commit
4f8c15d7d0
|
|
@ -75,9 +75,20 @@ def run(typ, freq, data):
|
|||
#
|
||||
# building message for ZVEI
|
||||
#
|
||||
if globalVars.config.get("Pushover", "zvei_sep_prio") == '1':
|
||||
if data["zvei"] in globalVars.config.get("Pushover", "zvei_prio2"):
|
||||
priority = '2'
|
||||
elif data["zvei"] in globalVars.config.get("Pushover","zvei_prio1"):
|
||||
priority = '1'
|
||||
elif data["zvei"] in globalVars.config.get("Pushover","zvei_prio0"):
|
||||
priority = '0'
|
||||
else:
|
||||
priority = '-1'
|
||||
else:
|
||||
priority = globalVars.config.get("Pushover","zvei_std_prio")
|
||||
|
||||
message = globalVars.config.get("Pushover", "zvei_message")
|
||||
title = globalVars.config.get("Pushover", "zvei_title")
|
||||
priority = globalVars.config.get("Pushover", "zvei_prio")
|
||||
logging.debug("Sending message: %s", message)
|
||||
|
||||
elif typ == "POC":
|
||||
|
|
@ -86,17 +97,27 @@ def run(typ, freq, data):
|
|||
# Pushover-Request
|
||||
#
|
||||
logging.debug("send Pushover for %s", typ)
|
||||
|
||||
if data["function"] == '1':
|
||||
priority = globalVars.config.get("Pushover", "SubA")
|
||||
elif data["function"] == '2':
|
||||
priority = globalVars.config.get("Pushover", "SubB")
|
||||
elif data["function"] == '3':
|
||||
priority = globalVars.config.get("Pushover", "SubC")
|
||||
elif data["function"] == '4':
|
||||
priority = globalVars.config.get("Pushover", "SubD")
|
||||
else:
|
||||
priority = 0
|
||||
if globalVars.config.get("Pushover", "poc_spec_ric") == '0':
|
||||
if data["function"] == '1':
|
||||
priority = globalVars.config.get("Pushover", "SubA")
|
||||
elif data["function"] == '2':
|
||||
priority = globalVars.config.get("Pushover", "SubB")
|
||||
elif data["function"] == '3':
|
||||
priority = globalVars.config.get("Pushover", "SubC")
|
||||
elif data["function"] == '4':
|
||||
priority = globalVars.config.get("Pushover", "SubD")
|
||||
else:
|
||||
priority = 0
|
||||
else:
|
||||
if data["ric"] in globalVars.config.get("Pushover", "poc_prio2"):
|
||||
priority = 2
|
||||
elif data["ric"] in globalVars.config.get("Pushover","poc_prio1"):
|
||||
priority = 1
|
||||
elif data["ric"] in globalVars.config.get("Pushover","poc_prio0"):
|
||||
priority = 0
|
||||
else:
|
||||
priority = -1
|
||||
|
||||
message = globalVars.config.get("Pushover", "poc_message")
|
||||
title = globalVars.config.get("Pushover", "poc_title")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue