diff --git a/plugins/Sms77/Sms77.py b/plugins/Sms77/Sms77.py index 61d9078..82ae514 100644 --- a/plugins/Sms77/Sms77.py +++ b/plugins/Sms77/Sms77.py @@ -58,6 +58,20 @@ def run(typ,freq,data): """ try: if configHandler.checkConfig("Sms77"): #read and debug the config + + # create an empty message an fill it with the required information + message = "" + if typ == "FMS": + logging.debug("FMS detected, building message") + message = data["description"]+"
"+data["status"] + elif typ == "ZVEI": + logging.debug("ZVEI detected, building message") + mesage = data["description"] + elif typ == "POC": + logging.debug("POC detected, building message") + message = data["description"]+"
"+data["msg"].replace(";", "
") + else: + logging.warning("Invalid typ - use empty message") try: @@ -74,7 +88,7 @@ def run(typ,freq,data): "to": globalVars.config.get("Sms77", "to"), "from": globalVars.config.get("Sms77", "from"), "type": globalVars.config.get("Sms77", "type"), - "text": data["description"]+"
"+data["msg"].replace(";", "
") + "text": message }),{"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}) except: