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

Add Battery level pop-up 🔋🪫 #3310

Open
wants to merge 79 commits into
base: community
Choose a base branch
from

Conversation

m0nkmaster
Copy link
Contributor

@m0nkmaster m0nkmaster commented Jan 23, 2025

Add Battery Health Pop-up and Power Management Improvements

Adds a new feature to display battery health pop-up on the OLED display and refactors the power management system for improved functionality and maintainability.

Key Changes:

  • Battery Health Pop-up:

    • Added a pop-up to the OLED display that shows the current battery level as a percentage and the remaining millivolts (mV).
    • The pop-up can be accessed by pressing SHIFT + CROSS SCREEN.
    • Charging is recommended when the battery voltage drops below 2900mV.
  • Power Management Refactor:

    • Introduced a new PowerManager class to handle power-related functionalities.
    • Moved battery voltage reading and LED indication logic to PowerManager.
    • Improved battery status detection with defined thresholds for CRITICAL, WARNING, HEALTHY, and FULL states.
    • Implemented a method to display power status on the OLED display.
  • Code Cleanup:

    • Removed redundant code related to battery voltage reading and LED control from deluge.cpp.
  • Documentation Updates:

    • Updated CHANGELOG.md and community_features.md to reflect the new battery health pop-up feature.

Follows this discussion:
#2991

…tialBatteryChange method for updates, and improved battery display rendering in session view.
LPF changes
…clarity, improved comments, and ensured consistent formatting in the battery icon rendering logic.
Copy link
Contributor

github-actions bot commented Feb 1, 2025

Test Results

108 tests  ±0   108 ✅ ±0   0s ⏱️ ±0s
 16 suites ±0     0 💤 ±0 
 16 files   ±0     0 ❌ ±0 

Results for commit 7d882d5. ± Comparison against base commit c85128f.

♻️ This comment has been updated with latest results.

@m0nkmaster m0nkmaster changed the title Add Battery Status Display to Session View 🔋🪫 @WIP - Add Battery Status Display to Session View 🔋🪫 Feb 3, 2025
@m0nkmaster
Copy link
Contributor Author

It's now working as I would want; as a pop-up. The trigger for this is shift and cross-screen, which I don't think is used elsewhere. Just got to add documentation and do a bit more testing.

Happy for anyone else to give it a test drive.

@m0nkmaster m0nkmaster changed the title @WIP - Add Battery Status Display to Session View 🔋🪫 Add Battery Status Display to Session View 🔋🪫 Feb 8, 2025
@m0nkmaster m0nkmaster changed the title Add Battery Status Display to Session View 🔋🪫 Add Battery level pop-up 🔋🪫 Feb 11, 2025
@seangoodvibes seangoodvibes marked this pull request as ready for review February 13, 2025 02:14
@m-m-adams
Copy link
Collaborator

Could you put it in the menu somewhere as well? We want to make everything findable without using shortcuts

#include "storage/storage_manager.h"
#include "system/power_manager.h"
#include "util/cfunctions.h"
#include "util/functions.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline here please, it's affecting how the includes are sorted and making the change bigger than it should be

Copy link
Collaborator

@stellar-aria stellar-aria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of stuff from clang-tidy that needs to be addressed, including naming conventions for new code and narrowing conversions

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.

4 participants