-
-
Notifications
You must be signed in to change notification settings - Fork 154
Add page to change battery parameters #522
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughA new battery configuration page is introduced via a Lua script, defining UI layout, labels, and fields for voltage and capacity settings. The main pages list is updated to include the "Battery" page for API versions 1.45 and above, referencing the newly added script. No existing logic is altered. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MainPages (pages.lua)
participant BatteryPage (battery.lua)
User->>MainPages: Open configuration menu
MainPages->>MainPages: Check apiVersion
alt apiVersion >= 1.45
MainPages->>BatteryPage: Load battery configuration page
BatteryPage->>User: Display battery settings UI
end
User->>BatteryPage: View or edit voltage/capacity fields
BatteryPage->>MainPages: Send read/write MSP commands as needed
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (5)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This PR adds a page to the script where the following battery settings can be changed:
I wanted to add a button for applying LiPo and Li-Ion presets, but had too many problems with it, so I excluded it from the commit.
This PR would supersede #515, which uses a different approach and did not work for me.
I set it to minimum API v1.45, as I was unsure since when Betaflight uses uint16 values for battery voltage instead of the legacy uint8 values - feel free to change this, if an older min API version is better.
Also is it possible to add a step value for the capacity input? So that it is changed in increments of 25 mAh instead of 1? I could not find anything about that in the code.
Summary by CodeRabbit