@@ -0,0 +1,2050 @@
+#!/usr/bin/env python%0A%0Afrom dbus.mainloop.glib import DBusGMainLoop%0Aimport gobject%0Aimport argparse%0Aimport logging%0Aimport sys%0Aimport os%0A%0A# our own packages%0Asys.path.insert(1, os.path.join(os.path.dirname(__file__), '../ext/velib_python'))%0Afrom dbusdummyservice import DbusDummyService%0Afrom logger import setup_logging%0A%0A# Argument parsing%0Aparser = argparse.ArgumentParser(%0A    description='dummy dbus service'%0A)%0A%0Aparser.add_argument(%22-n%22, %22--name%22,%0A    help=%22the D-Bus service you want me to claim%22,%0A    type=str, default=%22com.victronenergy.battery.socketcan_can0%22)%0A%0Aargs = parser.parse_args()%0A%0Aprint(__file__ + %22 is starting up, use -h argument to see optional arguments%22)%0Alogger = setup_logging(debug=True)%0A%0A# Have a mainloop, so we can send/receive asynchronous calls to and from dbus%0ADBusGMainLoop(set_as_default=True)%0A%0As = DbusDummyService(%0A    servicename=args.name,%0A    deviceinstance=0,%0A    paths=%7B%0A        '/Alarms/CellImbalance': %7B'initial': 0%7D,%0A        '/Alarms/HighChargeCurrent': %7B'initial': 0%7D,%0A        '/Alarms/HighChargeTemperature': %7B'initial': 0%7D,%0A        '/Alarms/HighDischargeCurrent': %7B'initial': 0%7D,%0A        '/Alarms/HighTemperature': %7B'initial': 0%7D,%0A        '/Alarms/HighVoltage': %7B'initial': 0%7D,%0A        '/Alarms/InternalFailure': %7B'initial': 0%7D,%0A        '/Alarms/LowChargeTemperature': %7B'initial': 0%7D,%0A        '/Alarms/LowTemperature': %7B'initial': 0%7D,%0A        '/Alarms/LowVoltage': %7B'initial': 0%7D,%0A%0A        '/Soc': %7B'initial': 40%7D,%0A        '/Dc/0/Voltage': %7B'initial': 25%7D,%0A        '/Dc/0/Current': %7B'initial': 20%7D,%0A        '/Dc/0/Power': %7B'initial': 500%7D,%0A        '/Dc/0/Temperature': %7B'initial': 23.8%7D,%0A        '/Info/BatteryLowVoltage': %7B'initial': 23%7D,%0A        '/Info/MaxChargeCurrent': %7B'initial': 600%7D,%0A        '/Info/MaxChargeVoltage': %7B'initial': 28.4%7D,%0A        '/Info/MaxDischargeCurrent': %7B'initial': 600%7D,%0A    %7D,%0A    productname='ACME BMS battery',%0A    connection='CAN-bus')%0A%0Alogger.info('Connected to dbus, and switching over to gobject.MainLoop() (= event based)')%0Amainloop = gobject.MainLoop()%0Amainloop.run()%0A%0A%0A%0A%0A

Add dummy canbus-battery service for testing.