Skip to content

Commit 97cf837

Browse files
Madh93KazuCocoa
authored andcommitted
Set None as default value to lock device (#227)
* Set 0 as default value to lock device * Set None as default value instead of 0
1 parent 1923f6f commit 97cf837

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

appium/webdriver/webdriver.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,16 +940,20 @@ def end_test_coverage(self, intent, path):
940940
}
941941
return self.execute(Command.END_TEST_COVERAGE, data)['value']
942942

943-
def lock(self, seconds):
943+
def lock(self, seconds=None):
944944
"""Lock the device. No changes are made if the device is already unlocked.
945945
946946
:Args:
947-
- seconds - the duration to lock the device, in seconds.
947+
- seconds - (optional) the duration to lock the device, in seconds.
948948
The device is going to be locked forever until `unlock` is called
949949
if it equals or is less than zero, otherwise this call blocks until
950950
the timeout expires and unlocks the screen automatically.
951951
"""
952-
self.execute(Command.LOCK, {'seconds': seconds})
952+
if seconds is None:
953+
self.execute(Command.LOCK)
954+
else:
955+
self.execute(Command.LOCK, {'seconds': seconds})
956+
953957
return self
954958

955959
def unlock(self):

0 commit comments

Comments
 (0)