LightningPiggy / lightning-piggy

LILYGO TTGO T5 2.13 and 2.66 inch DEPG ePaper Display
https://www.lightningpiggy.com/
GNU Lesser General Public License v2.1
6 stars 4 forks source link

Make notification code more generic #5

Closed ThomasFarstrike closed 6 months ago

ThomasFarstrike commented 1 year ago

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:

ThomasFarstrike commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

https://github.com/LightningPiggy/lightning-piggy/tree/issue-5-generic-notifications

ThomasFarstrike commented 6 months ago

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