Skip to content

Instantly share code, notes, and snippets.

@jwatte
Created August 3, 2014 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwatte/57ed2069d2287d4abc3b to your computer and use it in GitHub Desktop.
Save jwatte/57ed2069d2287d4abc3b to your computer and use it in GitHub Desktop.
dbusvolt.py module using dbus
import dbus
class DBusVolt(object):
def __init__(self):
self.bus = dbus.SystemBus()
self.svc = self.bus.get_object('net.watte.robots.voltmon', '/net/watte/robots/voltmon')
self.readfn = self.svc.get_dbus_method('read', 'net.watte.robots.voltmon')
self.offfn = self.svc.get_dbus_method('off', 'net.watte.robots.voltmon')
def read(self):
return self.readfn()
def off(self):
self.offfn()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment