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

Make notification code more generic #5

Closed
ThomasFarstrike opened this issue Sep 2, 2023 · 4 comments
Closed

Make notification code more generic #5

ThomasFarstrike opened this issue Sep 2, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ThomasFarstrike
Copy link

ThomasFarstrike commented Sep 2, 2023

Currently, the device has an informal "notification area" on the bottom left of the display. It gets used when the battery is low, for the "LOW BATTERY" text in white font on black background.

It would be good to make the code for these notifications more generic, with a simple function like "showNotification(String text)". Optionally, there could be an "int durationSeconds" for the notification, or an "int priority" to allow for timed notifications and priorities.

To test and prove that the new generic code works well, the existing "low battery" notification should be made to use the generic code.

After that's done, this new notification code might be used for all types of notifications that we might want to show to the user.
Things like:

  • wifi SSID not found
  • wifi password incorrect
  • other wifi errors
  • cant connect to lnbits host
  • lnbits protocol issue
  • lnbits api key invalid
  • update available (maybe, see Show update notifications on the display #4 for considerations regarding the update notifications)
@ThomasFarstrike
Copy link
Author

Things like:

  • wifi SSID not found
  • wifi password incorrect
  • other wifi errors

These are now handled by dedicated wifi troubleshooting code, which uses the generic "displayFit()" function.

This is handled by a small subtle update notification next to the version number. Rationale in issue #4.

@ThomasFarstrike
Copy link
Author

ThomasFarstrike commented Feb 26, 2024

cant connect to lnbits host
lnbits protocol issue
lnbits api key invalid

These errors result in a failed balance fetch, and then the generic displayBoldMessage (merged as part of lonerookie's code and then improved) is used to show a notification.

@ThomasFarstrike
Copy link
Author

@ThomasFarstrike
Copy link
Author

This is ready and deployed in v2.0.0 in the webinstaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant