mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
FMS and ZVEI Support
This commit is contained in:
parent
9101ce33e1
commit
7fe98e2516
|
|
@ -552,14 +552,9 @@ commandZVEI =
|
|||
commandPOC =
|
||||
|
||||
[mqtt]
|
||||
#Plugin for publish POCSAG Alarm wit MQTT
|
||||
|
||||
#Adress from MQTT-Broker (Example: 192.168.178.27)
|
||||
brokeraddress =
|
||||
|
||||
#Example:
|
||||
#topic = alarm/posac
|
||||
topic =
|
||||
#Adress from MQTT-Broker
|
||||
brokeraddress = 192.168.178.27
|
||||
topic = alarm/posac
|
||||
|
||||
#####################
|
||||
##### Not ready yet #
|
||||
|
|
|
|||
|
|
@ -80,9 +80,21 @@ def run(typ,freq,data):
|
|||
mqttClient = mqtt.Client()
|
||||
|
||||
if typ == "FMS":
|
||||
logging.warning("%s not supported", typ)
|
||||
x = {
|
||||
"fms": data["fms"],
|
||||
"status": data["status"],
|
||||
"direction": data["direction"],
|
||||
"directionText": data["directionText"],
|
||||
"tsi": data["tsi"],
|
||||
"description": data["description"],
|
||||
"timestamp": timeHandler.curtime()
|
||||
}
|
||||
elif typ == "ZVEI":
|
||||
logging.warning("%s not supported", typ)
|
||||
x = {
|
||||
"zvei": data["zvei"],
|
||||
"description": data["description"],
|
||||
"timestamp": timeHandler.curtime()
|
||||
}
|
||||
elif typ == "POC":
|
||||
functionText = "%FUNCTEXT%"
|
||||
functionText = wildcardHandler.replaceWildcards(functionText, data)
|
||||
|
|
@ -96,11 +108,12 @@ def run(typ,freq,data):
|
|||
"description": data["description"],
|
||||
"timestamp": timeHandler.curtime()
|
||||
}
|
||||
else:
|
||||
logging.warning("Invalid Typ: %s", typ)
|
||||
|
||||
y = json.dumps(x)
|
||||
mqttClient.connect(broker_address)
|
||||
mqttClient.publish(topic,y)
|
||||
else:
|
||||
logging.warning("Invalid Typ: %s", typ)
|
||||
########## User Plugin CODE ##########
|
||||
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue