diff --git a/plugin_test/boswatch.py b/plugin_test/boswatch.py index b7ed95f..e7aa883 100644 --- a/plugin_test/boswatch.py +++ b/plugin_test/boswatch.py @@ -42,8 +42,6 @@ def throwAlarm(typ,data): logging.debug(i["name"] + " Plugin called") plugin.run(typ,"0",data) - - # Programm try: @@ -80,7 +78,6 @@ try: parser.add_argument("-s", "--squelch", help="Level of Squelch", type=int, default=0) parser.add_argument("-v", "--verbose", help="Shows more Information", action="store_true") parser.add_argument("-q", "--quiet", help="Shows no Information. Only Logfiles", action="store_true") - args = [] args = parser.parse_args() except: logging.exception("cannot parse args") @@ -348,7 +345,7 @@ try: except KeyboardInterrupt: logging.warning("Keyboard Interrupt") except: - logging.exception("") + logging.exception("unknown error") finally: try: # rtl_fm.terminate() diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 9fff55c..1e2eccc 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -6,9 +6,24 @@ import globals # Global variables def run(typ,freq,data): try: - if typ == "ZVEI": - logging.info("ZVEI: %s wurde auf %s empfangen!", data["zvei"],freq) - else: - logging.warning(typ + " not implemented") + logging.debug("read config file") + data1 = globals.config.get("template", "data1") + data2 = globals.config.get("template", "data2") + data3 = globals.config.get("template", "data3") + data4 = globals.config.get("template", "data4") + logging.debug(" - Data1: %s", data1) + logging.debug(" - Data2: %s", data2) + logging.debug(" - Data3: %s", data3) + logging.debug(" - Data4: %s", data4) + + if typ == "FMS": + logging.debug("FMS: %s Status: %s Dir: $s", data["fms"], data["status", data["direction") + elif typ == "ZVEI": + logging.debug("ZVEI: %s", data["zvei"]) + elif typ == "POC": + logging.debug("POC: %s/%s - %s", data["ric"], data["function"], data["msg"]) + else + logging.warning(typ + " not supportet") + except: - logging.exception("") \ No newline at end of file + logging.exception("unknown error") \ No newline at end of file