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

feat: set compass power off when screen is off #856

Merged
merged 1 commit into from Oct 21, 2021

Conversation

VSerain
Copy link
Contributor

@VSerain VSerain commented Oct 21, 2021

No description provided.

@gfwilliams
Copy link
Member

gfwilliams commented Oct 21, 2021

Hi - thanks!

However I think as-is this doesn't actually work... The Bangle.on('kill' event is for right before the app closes - and when the app closes the compass would be turned off automatically.

I think what you want is actually something like:

Bangle.on('lcdPower', function(isOn) {
  if (isOn) startdraw();
  else stopdraw();
});

You'd need to restart the timer (with intervalRef = setInterval) in startdraw too

@VSerain
Copy link
Contributor Author

VSerain commented Oct 21, 2021

@VSerain don't forget update changelog :) (Yes i regularly talk to me ;))

@VSerain
Copy link
Contributor Author

VSerain commented Oct 21, 2021

Hello @gfwilliams,
You want to say when the screen is off, bangle kill app ?

PS: I have received my bangle1 yesterday, it's excellent and fun ! Thanks for your work !

@VSerain VSerain force-pushed the arrow-app-disable-compass branch from af49dd9 to 1036f8d Compare Oct 21, 2021
@VSerain VSerain force-pushed the arrow-app-disable-compass branch from 1036f8d to 86ad7ee Compare Oct 21, 2021
@gfwilliams
Copy link
Member

gfwilliams commented Oct 21, 2021

Thanks! No, all I meant was to stop the compass, which I think you have done?

@gfwilliams gfwilliams merged commit 89895a4 into espruino:master Oct 21, 2021
@VSerain
Copy link
Contributor Author

VSerain commented Oct 21, 2021

Yes, the compass is stopped when screen is off. Thanks for merge !

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

Successfully merging this pull request may close these issues.

None yet

2 participants