Пример #1
0
def main():
    disp = Dispatcher()
    Tasklet.new(disp.loop)()
    host = Host(disp, "/dev/ttySP1")
    disp.add_host(host)
    while True:
        host.send([0x45])
Пример #2
0
def main():
    disp = Dispatcher()
    Tasklet.new(disp.loop)()
    host = Host(disp, "/dev/ttySP1")
    disp.add_host(host)
    while True:
        host.send([0x45])
Пример #3
0
 def route(self, request):
     hint = getattr(request, "routeHint", None)
     if hint == "relays":
         return self.relayscontrol
     elif hint == "main":
         return self.maincontrol
     else:
         return Dispatcher.route(self, request)
Пример #4
0
 def route(self, request):
     hint = getattr(request, "routeHint", None)
     if hint == "relays":
         return self.relayscontrol
     elif hint == "main":
         return self.maincontrol
     else:
         return Dispatcher.route(self, request)
Пример #5
0
 def __init__(self):
     Dispatcher.__init__(self)
     self.relays = [0, 0, 0, 0]
Пример #6
0
 def __init__(self):
     Dispatcher.__init__(self)
     self.relays = [0, 0, 0, 0]