diff --git a/apps/OrionContextBroker/config.json b/apps/OrionContextBroker/config.json index 49fe4a0..1f90c83 100644 --- a/apps/OrionContextBroker/config.json +++ b/apps/OrionContextBroker/config.json @@ -1,11 +1,11 @@ { "name": "OrionContextBroker", - "ep": "http://localhost:8000", + "ep": "http://localhost:18000", "cse_base": "onem2m", "poas": [ "http://auto:25396" ], - "originator_pre": "//openmtc.org/mn-cse-1", + "originator_pre": "//openmtc.org/in-cse-1", "ssl_certs": { "cert_file": null, "key_file": null, @@ -15,7 +15,7 @@ "level": "ERROR", "file": null }, - "labels": [""], + "labels": ["openmtc:sensor_data:temperature", "openmtc:sensor_data:humidity"], "interval": 10, "orion_host": "http://localhost:1026", "orion_api": "v2" diff --git a/apps/OrionContextBroker/etc/conf/config.json.dist b/apps/OrionContextBroker/etc/conf/config.json.dist index 7162cb0..a931874 100644 --- a/apps/OrionContextBroker/etc/conf/config.json.dist +++ b/apps/OrionContextBroker/etc/conf/config.json.dist @@ -16,7 +16,7 @@ "file": "/var/log/openmtc/orioncontextbroker.log" }, "labels": [], - "interval": 1, + "interval": 10, "orion_host": "http://localhost:1026", "orion_api": "v2" } diff --git a/apps/OrionContextBroker/src/orioncontextbroker/__init__.py b/apps/OrionContextBroker/src/orioncontextbroker/__init__.py index 5e91faf..ba08560 100644 --- a/apps/OrionContextBroker/src/orioncontextbroker/__init__.py +++ b/apps/OrionContextBroker/src/orioncontextbroker/__init__.py @@ -7,4 +7,4 @@ __version__ = "0.1" __description__ = "OrionContextBroker" __author_name__ = "Christian Klopp" __author_mail__ = "christian.klopp@fokus.fraunhofer.de" -__requires__ = [] +__requires__ = ["requests"] diff --git a/apps/OrionContextBroker/src/orioncontextbroker/__main__.py b/apps/OrionContextBroker/src/orioncontextbroker/__main__.py index 97cac93..e2ee90e 100644 --- a/apps/OrionContextBroker/src/orioncontextbroker/__main__.py +++ b/apps/OrionContextBroker/src/orioncontextbroker/__main__.py @@ -14,17 +14,17 @@ default_orion_api = "v2" # args parser parser = ArgumentParser( - description="Stores OpenMTC Date in an\ - instance of the Orion Context Broker", + description="Stores OpenMTC Date in an instance of the " + "Orion Context Broker", prog="OrionContextBroker", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument("-n", "--name", help="Name used for the AE.") parser.add_argument("-s", "--ep", help="URL of the local Endpoint.") parser.add_argument("--orion_host", help="URL of Orion CB") -parser.add_argument("--orion_api", help="Orion CB Api version (possible\ - values: \"v2\")") -parser.add_argument('--labels', type=str, help='just subscribe to those\ - labels', nargs='+') +parser.add_argument("--orion_api", help="Orion CB Api version (possible " + "values: \"v2\")") +parser.add_argument('--labels', type=str, help='just subscribe to those ' + 'labels', nargs='+') parser.add_argument('--interval', type=int, help='update interval (s)') # args, config and logging @@ -37,8 +37,8 @@ ep = get_value("ep", (unicode, str), default_ep, args, config) poas = config.get("poas", ["http://auto:25396"]) originator_pre = config.get("originator_pre", "//openmtc.org/mn-cse-1") ssl_certs = config.get("ssl_certs", {}) -interval = get_value("interval", (int), default_ep, args, config) -lbl = get_value("labels", (list), default_labels, args, config) +interval = get_value("interval", int, default_ep, args, config) +lbl = get_value("labels", list, default_labels, args, config) orion_host = get_value("orion_host", (unicode, str), default_orion_host, args, config) orion_api = get_value("orion_api", (unicode, str), @@ -46,8 +46,8 @@ orion_api = get_value("orion_api", (unicode, str), # start app = OrionContextBroker( - labels=lbl, interval=interval, orion_host=orion_host, orion_api=orion_api, - name=nm, cse_base=cb, poas=poas, + orion_host=orion_host, orion_api=orion_api, labels=lbl, + interval=interval, name=nm, cse_base=cb, poas=poas, originator_pre=originator_pre, **ssl_certs ) Runner(app).run(ep)