예제 #1
0
    def __init__(self, settings=None, verbose=False, monitor=False):
        """
        Class constructor
        
        @param settings: path to the main configuration file
        @param verbose: Print out SWAP frames or not
        @param monitor: Print out network events or not
        """
        try:
            # Superclass call
            SwapInterface.__init__(self, settings, verbose)
        except:
            raise

        # Print SWAP activity
        self._printSWAP = monitor
        # Mote address in SYNC mode
        self._addrInSyncMode = None
        
        # Read plugin config
        self._readPluginConfig()
        
        # Declare HouseAgent callbacks
        callbacks = {'poweron': self.cb_poweron,
                     'poweroff': self.cb_poweroff,
                     'custom': self.cb_custom,
                     'thermostat_setpoint': self.cb_thermostat}
        
        # Start plugin
        self._pluginapi = PluginAPI(guid=self.pluginId, plugintype="SWAP", broker_host=self.broker_host, broker_port=self.broker_port, **callbacks)
        self._pluginapi.ready()
        reactor.run()
예제 #2
0
 def __init__(self, verbose=False, monitor=False):
     """
     Class constructor
     
     'verbose'  Print out SWAP frames or not
     'monitor'  Print out network events or not
     """
     # Superclass call
     SwapInterface.__init__(self, None, verbose)
     # Print SWAP activity
     self._printSWAP = monitor
     # Mote address in SYNC mode
     self._addrInSyncMode = None
예제 #3
0
 def __init__(self, verbose=False, monitor=False):
     """
     Class constructor
     
     'verbose'  Print out SWAP frames or not
     'monitor'  Print out network events or not
     """
     # Superclass call
     SwapInterface.__init__(self, None, verbose)        
     # Print SWAP activity
     self._printSWAP = monitor
     # Mote address in SYNC mode
     self._addrInSyncMode = None
예제 #4
0
    def __init__(self, settings=None, verbose=False, monitor=False):
        """
        Class constructor
        
        @param settings: path to the main configuration file
        @param verbose: Print out SWAP frames or not
        @param monitor: Print out network events or not
        """
        try:
            # Superclass call
            SwapInterface.__init__(self, settings, verbose)
        except:
            raise

        # Print SWAP activity
        self._printSWAP = monitor
        # Mote address in SYNC mode
        self._addrInSyncMode = None

        # Read plugin config
        self._readPluginConfig()

        # Declare HouseAgent callbacks
        callbacks = {
            'poweron': self.cb_poweron,
            'poweroff': self.cb_poweroff,
            'custom': self.cb_custom,
            'thermostat_setpoint': self.cb_thermostat
        }

        # Start plugin
        self._pluginapi = PluginAPI(guid=self.pluginId,
                                    plugintype="SWAP",
                                    broker_host=self.broker_host,
                                    broker_port=self.broker_port,
                                    **callbacks)
        self._pluginapi.ready()
        reactor.run()