mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
add filter check to alarm
add filter.checkFilters() to alarmHandler.processAlarm()
This commit is contained in:
parent
206463f8e9
commit
02a84b6ec9
|
|
@ -7,8 +7,10 @@ from includes import globals # Global variables
|
|||
|
||||
def processAlarm(typ,freq,data):
|
||||
logging.debug("[ ALARM ]")
|
||||
for name, plugin in globals.pluginList.items():
|
||||
logging.debug("call Plugin: %s", name)
|
||||
plugin.run(typ,freq,data)
|
||||
logging.debug("return from: %s", name)
|
||||
for pluginName, plugin in globals.pluginList.items():
|
||||
from includes import filter
|
||||
if filter.checkFilters(data,typ,pluginName):
|
||||
logging.debug("call Plugin: %s", pluginName)
|
||||
plugin.run(typ,freq,data)
|
||||
logging.debug("return from: %s", pluginName)
|
||||
logging.debug("[END ALARM]")
|
||||
|
|
@ -23,6 +23,11 @@ def checkFilters(data,typ,plugin):
|
|||
try:
|
||||
logging.debug("search Filter for %s to %s", typ, plugin)
|
||||
|
||||
#extract the correct data for filtering
|
||||
if typ == "FMS": data = data["fms"]
|
||||
if typ == "ZVEI": data = data["zvei"]
|
||||
if typ == "POC": data = data["poc"]
|
||||
|
||||
foundFilter = False
|
||||
for i in globals.filterList:
|
||||
if i["typ"] == typ and i["plugin"] == plugin:
|
||||
|
|
|
|||
Loading…
Reference in a new issue