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

Determine which event is fired #67

Open
vienom opened this issue Sep 17, 2018 · 1 comment
Open

Determine which event is fired #67

vienom opened this issue Sep 17, 2018 · 1 comment
Labels

Comments

@vienom
Copy link

vienom commented Sep 17, 2018

I want to check when the device is plugged in. Is there a way to check if the fired event is because of a level change or the plugging in?

@janpio janpio added the support label Sep 17, 2018
@timbru31
Copy link
Member

timbru31 commented Mar 2, 2019

I assume you listen to the batterystatus event? You can always evaluate the isPlugged property. If you store the "old" status and compare it to the new one you should be able to determine if the event was fired because of a level change or the plugging in/out of the charger.

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

No branches or pull requests

3 participants