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 =
|
commandPOC =
|
||||||
|
|
||||||
[mqtt]
|
[mqtt]
|
||||||
#Plugin for publish POCSAG Alarm wit MQTT
|
#Adress from MQTT-Broker
|
||||||
|
brokeraddress = 192.168.178.27
|
||||||
#Adress from MQTT-Broker (Example: 192.168.178.27)
|
topic = alarm/posac
|
||||||
brokeraddress =
|
|
||||||
|
|
||||||
#Example:
|
|
||||||
#topic = alarm/posac
|
|
||||||
topic =
|
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
##### Not ready yet #
|
##### Not ready yet #
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,21 @@ def run(typ,freq,data):
|
||||||
mqttClient = mqtt.Client()
|
mqttClient = mqtt.Client()
|
||||||
|
|
||||||
if typ == "FMS":
|
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":
|
elif typ == "ZVEI":
|
||||||
logging.warning("%s not supported", typ)
|
x = {
|
||||||
|
"zvei": data["zvei"],
|
||||||
|
"description": data["description"],
|
||||||
|
"timestamp": timeHandler.curtime()
|
||||||
|
}
|
||||||
elif typ == "POC":
|
elif typ == "POC":
|
||||||
functionText = "%FUNCTEXT%"
|
functionText = "%FUNCTEXT%"
|
||||||
functionText = wildcardHandler.replaceWildcards(functionText, data)
|
functionText = wildcardHandler.replaceWildcards(functionText, data)
|
||||||
|
|
@ -96,11 +108,12 @@ def run(typ,freq,data):
|
||||||
"description": data["description"],
|
"description": data["description"],
|
||||||
"timestamp": timeHandler.curtime()
|
"timestamp": timeHandler.curtime()
|
||||||
}
|
}
|
||||||
y = json.dumps(x)
|
|
||||||
mqttClient.connect(broker_address)
|
|
||||||
mqttClient.publish(topic,y)
|
|
||||||
else:
|
else:
|
||||||
logging.warning("Invalid Typ: %s", typ)
|
logging.warning("Invalid Typ: %s", typ)
|
||||||
|
|
||||||
|
y = json.dumps(x)
|
||||||
|
mqttClient.connect(broker_address)
|
||||||
|
mqttClient.publish(topic,y)
|
||||||
########## User Plugin CODE ##########
|
########## User Plugin CODE ##########
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue