summaryrefslogtreecommitdiff
path: root/tests/amb-get-history.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/amb-get-history.py')
-rwxr-xr-xtests/amb-get-history.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/amb-get-history.py b/tests/amb-get-history.py
new file mode 100755
index 00000000..637e7d2b
--- /dev/null
+++ b/tests/amb-get-history.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+import argparse
+import json
+
+print "This application is deprecated. It will disappear in the future. Use ambctl"
+
+parser = argparse.ArgumentParser()
+parser.add_argument("get", help="{objectName}")
+parser.add_argument("start", help="{startTime}")
+parser.add_argument("end", help="{endTime}")
+parser.add_argument("zone", help="{zone}")
+
+args = parser.parse_args()
+
+objectName = args.get
+start = float(args.start)
+end = float(args.end)
+zone = int(args.zone)
+
+bus = dbus.SystemBus()
+managerObject = bus.get_object("org.automotive.message.broker", "/");
+managerInterface = dbus.Interface(managerObject, "org.automotive.Manager")
+
+object = managerInterface.FindObjectForZone(objectName, zone);
+
+propertiesInterface = dbus.Interface(bus.get_object("org.automotive.message.broker", object),"org.automotive."+objectName)
+print json.dumps(propertiesInterface.GetHistory(start,end),indent=2)