Created
August 3, 2014 22:17
-
-
Save jwatte/57ed2069d2287d4abc3b to your computer and use it in GitHub Desktop.
dbusvolt.py module using dbus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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