Ejemplo n.º 1
0
class Pimotica():
    bus = None
    config = None

    def __init__(self):
        self.bus = Bus()

    def start(self):
        self.config = self.loadConfig()
        self.bus.addDevice(
            TemperaturesensorDevice('inside temperature sensor'))

    def loadConfig(self):
        """Load the configuration and return it"""
        # TODO load from file
        #return {'devices': {'inside/temperature': {'type'}}}
        pass
Ejemplo n.º 2
0
class ServiceBus(object):

    def __init__(self, url=""):
        self._bus = Bus(url)

    def send(self, event, message):
        self._bus.send(event, message)

    def listen(self, event, callback):
        self._bus.listen(event, callback)

    def publish(self, event, message):
        self._bus.publish(event, message)

    def subscribe(self, event, callback):
        self._bus.subscribe(event, callback)
Ejemplo n.º 3
0
 def __init__(self):
     self.bus = Bus()
Ejemplo n.º 4
0
 def __init__(self, url=""):
     self._bus = Bus(url)