-
Notifications
You must be signed in to change notification settings - Fork 570
Support set_gsm_signal #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
fc441e6
1b0f797
73f35c0
a9f63d5
ddc93cb
5a03d31
bbbb9df
c2ee455
1ca58f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,14 +32,9 @@ def set_gsm_signal(self, strength): | |
:Args: | ||
- strength: Signal strength. Can be set Gsm.NONE_OR_UNKNOWN/POOR/MODERATE/GOOD/GREAT | ||
|
||
:Raises: | ||
- TypeError - Raises a TypeError if the argument is out of range | ||
|
||
:Usage: | ||
self.driver.set_gsm_signal(Gsm.GOOD) | ||
""" | ||
if strength not in [self.NONE_OR_UNKNOWN, self.POOR, self.MODERATE, self.GOOD, self.GREAT]: | ||
raise TypeError("{} is out of range. Use the value like Gsm.GOOD.".format(strength)) | ||
self.execute(Command.SET_GSM_SIGNAL, {'signalStrength': strength, 'signalStrengh': strength}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about returning an error message if a user selects out of https://github.com/appium/python-client/pull/357/files#diff-bb5916ee1320d1333f6c9ba19cf04705R22 ?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, seems good. |
||
return self | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is pretty good to show users which args can use for this method as either warn or error
(Here is client-side logic matter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added warning log instead of throwing exception.
Here is behavior.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits]
what about something like
{name for name, value in vars(self).items() if name.isupper()}
to show the consts instead of the number?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood for 1ca58f4
This log comes from https://github.com/appium/appium-adb/blob/527c8b417d7b62717ececfdf068309b0ee4dbd8f/lib/tools/adb-emu-commands.js#L168 .
So can't handle from client side.
Added log is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. I misunderstood it was the warning in this pr