Merge pull request #418 from grosj/Pushover

Sound-Settings für Pushover
This commit is contained in:
Bastian Schroll 2019-10-17 15:57:53 +02:00 committed by GitHub
commit 35b0c4d92e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -5,6 +5,7 @@
##### Changed
- MySQL-Plugin: Index für die RIC Adresse hinzugefügt [#411](https://github.com/Schrolli91/BOSWatch/issues/411)
- MySQL-Plugin: INSERT Befehl für MySQL 8.x angepasst, Spaltennamen escaped [#410](https://github.com/Schrolli91/BOSWatch/issues/410)
- Pushover-Plugin: Konfigurationsmöglichkeit für den Sound [#418](https://github.com/Schrolli91/BOSWatch/issues/418)
##### Deprecated
##### Removed
##### Fixed

View file

@ -351,6 +351,9 @@ api_key =
# Pushover Userkey or Groupkey to receive message
user_key =
# Pushover Sound
sound =
# Section for POCSAG
# Adapt Pocsag Subric (a,b,c,d) to Pushover Priorities (see https://pushover.net/api#priority)
SubA = 1

View file

@ -128,6 +128,10 @@ def run(typ, freq, data):
# replace the wildcards
message = wildcardHandler.replaceWildcards(message, data)
title = wildcardHandler.replaceWildcards(title, data)
sound = globalVars.config.get("Pushover", "sound")
# set Default-Sound
if not sound:
sound = "pushover"
# start the connection
conn = httplib.HTTPSConnection("api.pushover.net:443")
@ -138,6 +142,7 @@ def run(typ, freq, data):
"message": message,
"html": globalVars.config.get("Pushover", "html"),
"title": title,
"sound": sound,
"priority": priority,
"retry": globalVars.config.get("Pushover", "retry"),
"expire": globalVars.config.get("Pushover", "expire")