fw/services/battery: add optional 80% charge limit to extend battery lifespan#1156
fw/services/battery: add optional 80% charge limit to extend battery lifespan#1156spr4bhu wants to merge 2 commits into
Conversation
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
7c3ae43 to
a9117f6
Compare
|
Amazing, i have been meaning to circle back on this. Thank you so much! |
|
Awesome. Thanks for the PR! Need to add this behind one of the features that only enables the setting to be shown on the phone side. We're reducing how many settings are shown on the Watch UI and encouraging people to add the setting on the phone side. @jplexer do you have an example that we can show to folks on how to add this on both sides? |
| #define CHARGE_LIMIT_PCT 80 | ||
| #define CHARGE_RESUME_PCT 77 |
There was a problem hiding this comment.
While plugged in, if not charging, the watch will run from USB power, so the battery will not drain. I guess you can simply disable the charger and forget about any hysteresis.
There was a problem hiding this comment.
Made the changes, thanks.
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
93cd021 to
49c9c2a
Compare
|
@sjp4 can I have the format on how the features are to be added on phone side |
So then if the watch runs on USB power directly when plugged in, what's the use of a charge limit in the first place? The only reason to do that, then is to avoid topping up if the watch comes on and off the charger repeatedly, correct? That is something a user can simply avoid. But even if someone would put the watch on the charger say, every night, out of habit. Would it not be smarter then, to have a setting that goes like this: Do not charge to 100% (or some max level) unless you've been discharged to 80% (or some min level) or lower since being at or over the max level. That way you do allow a full charge, but not a repeated trickle charge at a high level (which is unnecessary if 80% gives multi-day operation). I am not a battery expert, but charging a battery to 100% is not so much the problem if I understand it correctly, it's keeping it there constantly via trickle charging, or discharging fully and leaving it there for any amount of time. I also heard that the best would be to keep Li-Ion between 40%-ish and 60%-ish at all times for maximum lifespan. So, I'd love a function where the watch simple alerts when it wants to be charged for maximum lifespan (via a notification) and beeps every 5 minutes for 5 - 10 seconds when it wants to come off the charger (or it simply ends charging and runs on the USB power) at 60%, again optimizing for battery health instead of charge frequency. I'd rather charge once a week for 10 years, than once every three weeks for 5 years... So I'd a good default and recommendation from a vendor and the freedom to override it. And while I bought two Time 2s to have a spare, I certainly would love the battery to last as long as possible. |
This PR adds a software charge limit feature that stops charging at 80% and resumes at 77% (3% hysteresis) to reduce lithium battery degradation from sustained high charge levels. The feature is exposed as a user-facing toggle in System settings, off by default.
Changes:
Add
battery_charge_limitmodule that callsbattery_set_charge_enable()to disable/re-enable charging based on battery percentage thresholds; includes a 60s rate limit to prevent rapid charger cycling and a 60s periodic timer to cover gaps in fuel gauge event delivery when charging is disabledAdd
charge_limit_enabledpref (persistent on/off setting viaSettingsFile, default false) with getter/setter following the existingstationary_mode_enabledpatternAdd "Charge Limit (80%)" toggle row in System settings menu, mirroring the existing "Stand-By Mode" toggle
Hook
battery_charge_limit_evaluate()intobattery_monitor_handle_state_change_event()andbattery_charge_limit_init()intobattery_monitor_init()Register
battery_charge_limit.cinservices/battery/wscript_buildResolves Ability to limit battery charge to X% #722