File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,20 @@ def set_power_capacity(self, percent):
2929 """
3030 self .execute (Command .SET_POWER_CAPACITY , {'percent' : percent })
3131
32+ def set_power_ac (self , ac_state ):
33+ """Emulate power state change on the connected emulator.
34+
35+ :Args:
36+ - state: The power ac state to be set
37+
38+ :Usage:
39+ self.driver.set_power_state('on')
40+ self.driver.set_power_state('off')
41+ """
42+ self .execute (Command .SET_POWER_AC , {'state' : ac_state })
43+
3244 def _addCommands (self ):
3345 self .command_executor ._commands [Command .SET_POWER_CAPACITY ] = \
3446 ('POST' , '/session/$sessionId/appium/device/power_capacity' )
47+ self .command_executor ._commands [Command .SET_POWER_AC ] = \
48+ ('POST' , '/session/$sessionId/appium/device/power_ac' )
Original file line number Diff line number Diff line change @@ -78,3 +78,4 @@ class MobileCommand(object):
7878 FINGER_PRINT = 'fingerPrint'
7979 SEND_SMS = 'sendSms'
8080 SET_POWER_CAPACITY = 'setPowerCapacity'
81+ SET_POWER_AC = 'setPowerAc'
You can’t perform that action at this time.
0 commit comments