Esempio n. 1
0
    def add(self):
        if self._mode != 'stop':
            return False

        try:
            pyzwave.add()
            self._mode = 'add'
            return True
        except:
            return False
Esempio n. 2
0
    def add(self):
        if self._mode != 'stop':
            return False

        try:
            pyzwave.add()
            self._mode = 'add'
            return True
        except:
            return False
Esempio n. 3
0
    def add(self):
        if self._mode != 'stop':
            logging.warning('need to stop first')
            return False

        try:
            pyzwave.add()
            self._mode = 'add'
            return True
        except:
            return False
Esempio n. 4
0
 def add(self):
     ret = False
     with self._global_lock:
         try:
             pyzwave.add()
             self._mode = MPTN.ADD_MODE
             ret = True
         except Exception as e:
             logger.error(
                 "fails to be ADD mode, now in %s mode error: %s\n%s" %
                 (self._mode[1], str(e), traceback.format_exc()))
     return ret