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

battery low alert #829

Closed
tehn opened this issue May 30, 2019 · 4 comments
Closed

battery low alert #829

tehn opened this issue May 30, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@tehn
Copy link
Member

@tehn tehn commented May 30, 2019

presently there is no alert if battery is very low.

perhaps we add a screen overlay when battery is below a threshold to alert the user.

@tehn tehn added the lua label May 30, 2019
@tehn tehn self-assigned this Jun 23, 2019
@tehn tehn added the menu label Jun 23, 2019
@tehn tehn added this to the 2.1.0 milestone Jun 23, 2019
@tehn tehn added the feature label Jun 23, 2019
@neauoire
Copy link

@neauoire neauoire commented Jun 27, 2019

I'd love to try this one, is there already a class that is allowed to draw over the currently running library?

@tehn
Copy link
Member Author

@tehn tehn commented Jun 28, 2019

the screen library is lua-managed here: https://github.com/monome/norns/blob/master/lua/core/screen.lua

the c bindings are the s_etc() functions.

scripts call screen.etc() which forwards the calls.

menu.lua manages PLAY vs. MENU mode. the script's redraw() is saved and redirected when toggling into MENU. https://github.com/monome/norns/blob/master/lua/core/menu.lua#L170

basically for a battery alert it seems reasonable to redefine screen.update() when the battery level drops below a certain level... with an overlay alert. it should be restored to normal when battery level is fine.

battery level callback is here: https://github.com/monome/norns/blob/master/lua/core/norns.lua#L39

welcome to the tangled mess which is the menu system (would love to rewrite it from scratch)

@neauoire
Copy link

@neauoire neauoire commented Jun 30, 2019

I can't manage to preserve what is underneath, what I am trying to do is create a :modal() method that will allow the lua core to write messages over the user's running script without completely overriding it. As soon as I redefine update(), it clears it. Any idea?

@tehn
Copy link
Member Author

@tehn tehn commented Jul 5, 2019

that's peculiar. i'll have to investigate the deeper workings.

@tehn tehn mentioned this issue Jul 11, 2019
@tehn tehn closed this in #859 Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants