Closed moyogii closed 5 months ago
The recent changes introduce a new feature to set a battery charge limit for Lenovo Legion devices within the HandheldCompanion application. This involves adding a new setting, UI components, and methods to handle the battery charge limit functionality. Additionally, a new name "PlasmidEve" was added to the AboutPage.
Files | Change Summary |
---|---|
HandheldCompanion/App.config, HandheldCompanion/Properties/Settings.settings | Added LegionBatteryChargeLimit setting with default False . |
HandheldCompanion/Devices/Lenovo/LegionGo.cs | Added methods SetBatteryChargeLimit , UpdateSettings , and event handler SettingsManager_SettingValueChanged . |
HandheldCompanion/Properties/Resources.Designer.cs, HandheldCompanion/Properties/Resources.resx | Added localized strings for battery charge limit settings. |
HandheldCompanion/Properties/Settings.Designer.cs | Added public boolean property LegionBatteryChargeLimit with getter and setter. |
HandheldCompanion/Views/Pages/AboutPage.xaml | Added "PlasmidEve" to the list of names. |
HandheldCompanion/Views/Pages/DevicePage.xaml | Added Border element for battery charge limit feature with child elements. |
HandheldCompanion/Views/Pages/DevicePage.xaml.cs | Added method Toggle_LegionBatteryChargeLimit_Toggled to handle toggle switch state. |
sequenceDiagram
participant User
participant DevicePage
participant LegionGo
participant SettingsManager
User ->> DevicePage: Toggle Battery Charge Limit
DevicePage ->> SettingsManager: Update Setting (LegionBatteryChargeLimit)
SettingsManager ->> LegionGo: Notify Setting Changed
LegionGo ->> LegionGo: UpdateSettings()
LegionGo ->> LegionGo: SetBatteryChargeLimit(enabled)
In the land of code, a change took flight,
For Legion's charge, a limit set just right.
Eighty percent, the battery's goal,
To keep it healthy, to keep it whole.
With toggles and switches, the settings align,
HandheldCompanion, for a longer battery time.
And PlasmidEve joins the hall of fame,
In the AboutPage, forever in name. 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Good job, merged
Adds 80% battery charge limit toggle for the Legion Go.
Initially, I was trying to do this through a function located in the SapientiaUSB.dll but I was unable to find anything of use. I did however find out through another project (LegionGoRemapper) that 0x03010001 handles the enabling or disabling of the 80% battery charge limit.
If there is an alternative way of doing this that makes more sense, please let me know!
Summary by CodeRabbit
New Features
UI Enhancements
Acknowledgements