Beispiel #1
0
 def check_condition(self):
     wait_time = 0
     while local_utils.is_device_connected(self.serial, self.except_charging) and\
           wait_time < self.timeout:
         time.sleep(2)
         wait_time += 2
     return not local_utils.is_device_connected(self.serial,
                                                self.except_charging)
Beispiel #2
0
    def check_condition(self):
        if self.not_check_result:
            return True
        wait_time = 0
        while not local_utils.is_device_connected(self.serial, self.except_charging) and\
                wait_time < self.timeout:
            time.sleep(2)
            wait_time += 2

        time.sleep(10)
        return local_utils.is_device_connected(self.serial,
                                               self.except_charging)
Beispiel #3
0
    def check_condition(self):
        wait_time = 0
        result = False
        while wait_time < self.timeout:
            if self.connect:
                time.sleep(10)
                if local_utils.is_device_connected(self.serial):
                    result = True
                    break
            else:
                if not local_utils.is_device_connected(self.serial):
                    result = True
                    break
            time.sleep(2)
            wait_time += 2

        return result