Anpassung auf Divera-Schnittstelle

Die Divera-API ist unter https://api.divera247.com beschrieben. Anpassungen an diese Schnittstellenbeschreibung.
Aus type wurde title.
This commit is contained in:
grosj 2019-10-21 15:19:27 +02:00 committed by GitHub
parent 0181075d3e
commit 0dfe1ee89c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,7 @@ def run(typ, freq, data):
# building message for FMS # building message for FMS
# #
text = globalVars.config.get("Divera", "fms_text") text = globalVars.config.get("Divera", "fms_text")
type = globalVars.config.get("Divera", "fms_type") title = globalVars.config.get("Divera", "fms_title")
priority = globalVars.config.get("Divera", "fms_prio") priority = globalVars.config.get("Divera", "fms_prio")
elif typ == "ZVEI": elif typ == "ZVEI":
@ -67,7 +67,7 @@ def run(typ, freq, data):
# building message for ZVEI # building message for ZVEI
# #
text = globalVars.config.get("Divera", "zvei_text") text = globalVars.config.get("Divera", "zvei_text")
type = globalVars.config.get("Divera", "zvei_type") title = globalVars.config.get("Divera", "zvei_title")
priority = globalVars.config.get("Divera","zvei_std_prio") priority = globalVars.config.get("Divera","zvei_std_prio")
elif typ == "POC": elif typ == "POC":
@ -86,7 +86,7 @@ def run(typ, freq, data):
priority = 'false' priority = 'false'
text = globalVars.config.get("Divera", "poc_text") text = globalVars.config.get("Divera", "poc_text")
type = globalVars.config.get("Divera", "poc_type") title = globalVars.config.get("Divera", "poc_title")
else: else:
logging.warning("Invalid type: %s", typ) logging.warning("Invalid type: %s", typ)
@ -100,10 +100,10 @@ def run(typ, freq, data):
# replace the wildcards # replace the wildcards
text = wildcardHandler.replaceWildcards(text, data) text = wildcardHandler.replaceWildcards(text, data)
type = wildcardHandler.replaceWildcards(type, data) title = wildcardHandler.replaceWildcards(title, data)
# Logging data to send # Logging data to send
logging.debug("Type : %s", type) logging.debug("Title : %s", title)
logging.debug("Text : %s", text) logging.debug("Text : %s", text)
logging.debug("Priority: %s", priority) logging.debug("Priority: %s", priority)
@ -116,7 +116,7 @@ def run(typ, freq, data):
conn.request("GET", "/api/alarm", conn.request("GET", "/api/alarm",
urllib.urlencode({ urllib.urlencode({
"accesskey": globalVars.config.get("Divera", "accesskey"), "accesskey": globalVars.config.get("Divera", "accesskey"),
"type": type, "title": title,
"text": text, "text": text,
"priority": priority, "priority": priority,
})) }))