-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add an endpoint for getting battery information #143
Conversation
final Intent batteryStatus = getBatteryStatusIntent(); | ||
final int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); | ||
final int scale = batteryStatus.getIntExtra(BatteryManager.EXTRA_SCALE, -1); | ||
return level * 1.0 / scale; |
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.
-1 * 1.0 / -1 = 1.0
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.
fixed
.getTargetContext()); | ||
try { | ||
response.put("level", batteryHelper.getLevel()); | ||
response.put("status", batteryHelper.getStatus()); |
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.
Can we change the response name of status
to state
like iOS?
Since when I implemented it in Ruby client, I faced appium/ruby_lib_core#85 (comment) error and it failed to parse status
as an error code of JsonWiredProtocol.
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 just wanted to keep system-specific terminology. In Android this indicator is called STATUS
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.
if we can, it'd be nice to have cross-platform compatibility for the API. is that possible 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.
ok, let's call is state
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.
ok, I'll rename that property on driver level
just because this was requested