Skip to content
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

Access battery level #82

Open
thegecko opened this issue Sep 2, 2016 · 5 comments
Open

Access battery level #82

thegecko opened this issue Sep 2, 2016 · 5 comments

Comments

@thegecko
Copy link

thegecko commented Sep 2, 2016

The current Rocky API doesn't mention a way of getting the current battery level, is this possible?
If not, would the watchInfo object be the best place to expose it?

@HBehrens
Copy link
Contributor

HBehrens commented Sep 2, 2016

There's currently no API that exposes the battery level. Following the idea of embracing web standards, our current plan is to implement the battery status API.

@thegecko
Copy link
Author

thegecko commented Sep 2, 2016

Great, how can I help?

@HBehrens
Copy link
Contributor

HBehrens commented Sep 2, 2016

First: Confirming that this would solve your particular use case.
Second: We still need suggestions for non-standard APIs, e.g. Health Data such as step count or heart rate.

I know, I am highjacking this Issue a but, sorry – but you were asking, so ¯_(ツ)_/¯

@thegecko
Copy link
Author

thegecko commented Sep 2, 2016

I want to show a battery level indicator on my watch face using rocky. The API is of less concern than the data, but following an existing spec. is always sensible.
The proposed API will allow a callback to be registered which can update a value on change, so this will satisfy my use case.

This should probably be on another thread, but one approach could be to have a standard eventListener model for when an established API doesn't exist.

You could also request data from known stores, similar to the characteristics on BLE.

My question about helping can also be read as:

Please show me an existing example of exposing an underlying data source through rocky which I could use as a template.

P.S. Looks like you will need to implement promises, too :)

@shaneporter
Copy link

Have just started using rockyjs and agree with @thegecko that non-standard APIs such as step count or heart rate are implemented as on callbacks, such as the existing memorypressure example.

I'd like to help too if I can, particularly as I note there's no current support for bluetooth connectivity status either.

Great work with rockyjs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants