mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-20 15:20:16 +01:00
Add ric prefixes to notifyMyAndroid-Plugin
Allow rics in nma.csv to be defined as prefixes
This commit is contained in:
parent
5d0e9055fe
commit
8b2bfab8b2
|
|
@ -281,6 +281,25 @@ def run(typ,freq,data):
|
|||
except KeyError:
|
||||
# nothing found
|
||||
pass
|
||||
# 3. lets look for ric prefixes in pocAPIKeyList
|
||||
for prefixLength in reversed(range(6)):
|
||||
ricPrefix = data['ric'][:prefixLength]
|
||||
#fill the ric with stars
|
||||
ricPrefix = ricPrefix.ljust(8,'*')
|
||||
try:
|
||||
xID = ricPrefix
|
||||
# data structure: pocAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
|
||||
for i in range(len(pocAPIKeyList[xID])):
|
||||
xEvent = event
|
||||
(xAPIKey, xPriority, xEventPrefix) = pocAPIKeyList[xID][i]
|
||||
if len(xEventPrefix) > 0:
|
||||
xEvent = xEventPrefix + ": " + xEvent
|
||||
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
|
||||
checkResponse(response, xAPIKey)
|
||||
except KeyError:
|
||||
# nothing found
|
||||
pass
|
||||
|
||||
# end if "POC" in typ
|
||||
# end if usecsv == True
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue